#include <bits/stdc++.h>
using namespace std;
int vis[110] = {0};
void dfs(int v);
vector<int> adj[110];
int main() {
  int n, m, x, y, i;
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = (int)0; i < (int)m; i++) {
    scanf("%d", &x);
    scanf("%d", &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  if (n != m) {
    printf("NO\n");
    return 0;
  }
  dfs(1);
  for (i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      printf("NO\n");
      return 0;
    }
  }
  printf("FHTAGN!\n");
  return 0;
}
void dfs(int v) {
  vis[v] = 1;
  int i;
  for (i = 0; i < adj[v].size(); i++) {
    if (vis[adj[v][i]] == 0) dfs(adj[v][i]);
  }
}
