#include <bits/stdc++.h>
using namespace std;
const int MAX_N = (100 + 10);
int N, M, cnt, mark[MAX_N];
vector<int> g[MAX_N];
void dfs(int u) {
  mark[u] = 1;
  ++cnt;
  for (int i = (0); i < ((int)g[u].size()); ++i) {
    int v = g[u][i];
    if (!mark[v]) dfs(v);
  }
}
int main() {
  while (cin >> N >> M) {
    for (int i = (1); i <= (N); ++i) g[i].clear();
    memset(mark, 0, sizeof(mark));
    for (int i = (1); i <= (M); ++i) {
      int u, v;
      cin >> u >> v;
      g[u].push_back(v);
      g[v].push_back(u);
    }
    if (N == M) {
      cnt = 0;
      dfs(1);
      cnt == N ? puts("FHTAGN!") : puts("NO");
    } else
      puts("NO");
  }
  return 0;
}
