#include <bits/stdc++.h>
using namespace std;
const int N = 101;
int mat[N][N];
bool chk[N];
int cnt;
int n, m;
void dfs(int now) {
  if (chk[now]) return;
  chk[now] = true;
  cnt++;
  for (int i = 1; i <= n; i++) {
    if (mat[now][i]) {
      dfs(i);
    }
  }
}
int main() {
  while (scanf("%d %d", &n, &m) == 2) {
    memset(mat, 0, sizeof(mat));
    memset(chk, 0, sizeof(chk));
    cnt = 0;
    for (int i = 0; i < m; i++) {
      int u, v;
      scanf("%d %d", &u, &v);
      mat[u][v] = mat[v][u] = 1;
    }
    if (n != m) {
      printf("NO\n");
      continue;
    }
    dfs(1);
    cnt == n ? printf("FHTAGN!\n") : printf("NO\n");
  }
  return 0;
}
