#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int p[N];
vector<int> adj[N], roots;
int n, m;
bool vis[N], root[N];
int S = 0, E = 0, cnt = 0;
void store(int u) {
  while (1) {
    root[u] = 1;
    roots.push_back(u);
    if (u == E) return;
    u = p[u];
  }
}
void dfs(int u) {
  vis[u] = 1;
  for (auto v : adj[u]) {
    if (!vis[v]) {
      p[v] = u;
      dfs(v);
    } else if (p[u] != v) {
      if (v == S) continue;
      S = u, E = v, cnt++;
    }
  }
}
int main() {
  for (int i = 0; i < N; i++) p[i] = 1;
  scanf("%d %d", &n, &m);
  int u, v;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &u, &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) dfs(i);
  if (!S || cnt > 1) {
    printf("NO\n");
    return 0;
  }
  store(S);
  for (int i = 0; i < N; i++) p[i] = 1;
  memset(vis, 0, sizeof vis);
  S = E = 0;
  for (auto R : roots) {
    vis[R] = 1;
    for (auto v : adj[R]) {
      if (root[v]) continue;
      p[v] = R;
      dfs(v);
      if (S) {
        printf("NO\n");
        return 0;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      printf("NO\n");
      return 0;
    }
  printf("FHTAGN!\n");
}
