#include <bits/stdc++.h>
struct Edge {
  int u, v, next;
} edge[100000];
int head[105], num[105];
bool visited[105];
int en, cnt, tt;
void add_edge(int u, int v) {
  edge[en].u = u;
  edge[en].v = v;
  edge[en].next = head[u];
  head[u] = en++;
}
void DFS1(int u) {
  int v;
  visited[u] = true;
  for (int id = head[u]; id != -1; id = edge[id].next) {
    v = edge[id].v;
    if (!visited[v]) DFS1(v);
  }
}
void DFS2(int u, int p) {
  int v;
  num[u] = tt++;
  visited[u] = true;
  for (int id = head[u]; id != -1; id = edge[id].next) {
    v = edge[id].v;
    if (v == p) continue;
    if (!visited[v])
      DFS2(v, u);
    else if (num[v] < num[u])
      cnt++;
  }
}
int main() {
  int n, m, u, v;
  en = 0;
  memset(head, 0xff, sizeof head);
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &u, &v);
    add_edge(u, v);
    add_edge(v, u);
  }
  memset(visited, false, sizeof visited);
  DFS1(1);
  cnt = 0;
  for (int i = 1; i <= n; i++)
    if (!visited[i]) cnt++;
  if (cnt)
    puts("NO");
  else {
    memset(visited, false, sizeof visited);
    cnt = tt = 0;
    DFS2(1, -1);
    if (cnt == 1)
      puts("FHTAGN!");
    else
      puts("NO");
  }
  return 0;
}
