#include <bits/stdc++.h>
bool map[105][105];
bool visit[105];
int n, m;
int cnt;
void Dfs(int num) {
  int i;
  for (i = 1; i <= n; i++) {
    if (!visit[i] && map[num][i]) {
      visit[i] = true;
      cnt++;
      Dfs(i);
    }
  }
}
int main() {
  while (scanf("%d%d", &n, &m) != EOF) {
    int i, a, b;
    memset(map, false, sizeof(map) / sizeof(bool));
    memset(visit, false, sizeof(visit) / sizeof(bool));
    for (i = 1; i <= m; i++) {
      scanf("%d%d", &a, &b);
      map[a][b] = map[b][a] = true;
    }
    if (n != m || n < 3) {
      printf("NO\n");
      continue;
    }
    visit[1] = true;
    cnt = 1;
    Dfs(1);
    if (cnt == n)
      printf("FHTAGN!\n");
    else
      printf("NO\n");
  }
  return 0;
}
