#include <bits/stdc++.h>
int g[110][110];
int v[110];
void dfs(int a, int n) {
  v[a] = 1;
  for (int i = 1; i <= n; i++) {
    if (g[a][i] && !v[i]) dfs(i, n);
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) g[i][j] = 0;
  memset(v, 0, sizeof(v));
  for (int i = 1; i <= m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    g[a][b] = 1;
    g[b][a] = 1;
  }
  if (n != m) {
    printf("NO\n");
    return 0;
  }
  dfs(1, n);
  for (int i = 1; i <= n; i++) {
    if (v[i] == 0) {
      printf("NO\n");
      return 0;
    }
  }
  printf("FHTAGN!\n");
  return 0;
}
