#include <bits/stdc++.h>
using namespace std;
bool p[128][128], q[128][128];
int cnt[128], n;
bool mark[128];
void dfs(int u) {
  if (mark[u]) return;
  mark[u] = true;
  for (int v = 1; v <= n; ++v)
    if (p[u][v]) dfs(v);
}
bool gao() {
  int m, a, b, i, j, t, f;
  scanf("%d%d", &n, &m);
  while (m--) {
    scanf("%d%d", &a, &b);
    q[a][b] = q[b][a] = p[a][b] = p[b][a] = true;
    ++cnt[a];
    ++cnt[b];
  }
  bool flag;
  dfs(1);
  for (i = 1; i <= n; ++i)
    if (!mark[i]) return false;
  t = n;
  do {
    flag = false;
    for (i = 1; i <= n; ++i)
      if (cnt[i] == 1) {
        cnt[i] = -1;
        --t;
        flag = true;
        for (j = 1; j <= n; ++j)
          if (q[i][j]) {
            q[j][i] = q[i][j] = false;
            --cnt[j];
          }
      }
  } while (flag);
  if (t < 3) return false;
  for (i = 1; i <= n; ++i)
    if (cnt[i] != -1 && cnt[i] != 2) return false;
  return true;
}
int main() {
  puts(gao() ? "FHTAGN!" : "NO");
  return 0;
}
