#include <bits/stdc++.h>
using namespace std;
const int N = 1e2 + 5;
int vis[N], n, m;
vector<int> adj[N];
void DFS(int u) {
  vis[u] = 1;
  for (auto v : adj[u]) {
    if (!vis[v]) DFS(v);
  }
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d %d", &u, &v);
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  int comps = 0;
  for (int i = 0; i < n; i++) {
    if (!vis[i]) {
      DFS(i);
      comps++;
    }
  }
  if (comps == 1 && n == m)
    puts("FHTAGN!");
  else
    puts("NO");
  return 0;
}
