#include <bits/stdc++.h>
using namespace std;
int n, m, a, b, ciclos, vertice_visited;
int pai[110], vis[110];
vector<int> adj[110];
void dfs(int v) {
  vis[v] = 1;
  vertice_visited++;
  for (int i = 0; i < adj[v].size(); i++) {
    int x = adj[v][i];
    if (vis[x]) {
      if (pai[v] != x) ciclos++;
      continue;
    }
    pai[x] = v;
    vis[x] = 1;
    dfs(x);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  while (m--) {
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  dfs(1);
  cout << (ciclos == 2 && vertice_visited == n ? "FHTAGN!" : "NO") << endl;
  return 0;
}
