#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const double eps = 1e-8;
const double pi = acos(-1.0);
bool g[110][110];
int n, m;
bool vis[110];
int flag;
bool dfs(int u, int f) {
  vis[u] = 1;
  for (int i = 1; i <= n; i++)
    if (i != f && g[u][i]) {
      if (vis[i]) {
        if (flag == 2) return false;
        flag++;
      } else {
        if (!dfs(i, u)) return false;
      }
    }
  return true;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    g[a][b] = g[b][a] = 1;
  }
  if (dfs(1, 1)) {
    for (int i = 1; i <= n; i++)
      if (!vis[i]) {
        flag = 0;
        break;
      }
    puts(flag ? "FHTAGN!" : "NO");
  } else
    puts("NO");
  return 0;
}
