#include <bits/stdc++.h>
using namespace std;
const int N = 110;
vector<int> G[N];
int vis[N];
void DFS(int cur) {
  vis[cur]++;
  int sz = G[cur].size();
  int v;
  for (int i = 0; i < sz; i++) {
    v = G[cur][i];
    if (!vis[v]) DFS(v);
  }
}
int main() {
  int n, m, u, v;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  DFS(1);
  for (int i = 1; i <= n; i++)
    if (!vis[i]) {
      cout << "NO";
      return 0;
    }
  if (n == m)
    cout << "FHTAGN!";
  else
    cout << "NO";
  return 0;
}
