#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int maxn = 1e2 + 10;
const double eps = 1e-9;
int mp[maxn][maxn];
int deg[maxn];
int vis[maxn];
int n, m;
void dfs(int u) {
  vis[u] = 1;
  for (int i = 1; i <= n; i++) {
    if (!vis[i] && mp[u][i]) {
      dfs(i);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  while (scanf("%d%d", &n, &m) != EOF) {
    memset(vis, 0, sizeof vis);
    for (int i = 0; i < m; i++) {
      int u, v;
      scanf("%d%d", &u, &v);
      mp[u][v] = mp[v][u] = 1;
    }
    if (n == m) {
      dfs(1);
      int flag = 1;
      for (int i = 1; i <= n; i++) {
        if (!vis[i]) flag = 0;
      }
      if (flag)
        puts("FHTAGN!");
      else
        puts("NO");
    } else
      puts("NO");
  }
  return 0;
}
