#include <bits/stdc++.h>
using namespace std;
int edge[105][105], k = 0, n, m;
bool mark[105];
void dfs(int rt) {
  if (mark[rt]) return;
  mark[rt] = 1;
  k++;
  for (int i = 1; i <= n; ++i)
    if (edge[rt][i] && !mark[i]) dfs(i);
}
int main() {
  scanf("%d%d", &n, &m);
  memset(edge, 0, sizeof(edge));
  for (int i = 0, a, b; i < m; ++i) {
    scanf("%d%d", &a, &b);
    edge[a][b] = edge[b][a] = 1;
  }
  if (n != m || n < 3) {
    puts("NO");
    return 0;
  }
  memset(mark, 0, sizeof(mark));
  dfs(1);
  if (k == n)
    puts("FHTAGN!");
  else
    puts("NO");
  return 0;
}
