#include <bits/stdc++.h>
using namespace std;
int n, cnt, cl[128];
vector<int> g[128];
void dfs(int v, int p) {
  cl[v] = 1;
  for (int u : g[v]) {
    if (u == p) continue;
    if (!cl[u])
      dfs(u, v);
    else if (cl[u] == 1) {
      cnt++;
    }
  }
  cl[v] = 2;
}
int main() {
  int m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  int c = 0;
  for (int i = 1; i <= n; i++) {
    if (!cl[i]) {
      dfs(i, 0);
      c++;
    }
  }
  if (cnt == 1 && c == 1)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
