#include <bits/stdc++.h>
using namespace std;
list<int> adj[101];
int m, n, x, y, cnt;
bool visited[101];
void dfs(int u) {
  visited[u] = true;
  ++cnt;
  for (list<int>::iterator it = adj[u].begin(); it != adj[u].end(); ++it)
    if (!visited[*it]) dfs(*it);
}
int main() {
  scanf("%d %d\n", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d", &x, &y);
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  if (n != m)
    puts("NO");
  else {
    dfs(1);
    if (cnt != n)
      puts("NO");
    else
      puts("FHTAGN!");
  }
  return 0;
}
