#include <bits/stdc++.h>
using namespace std;
int n, m;
int x, y;
vector<int> ga[200];
bool vis[200];
void dfs(int u) {
  vis[u] = true;
  for (int i = 0; i < ga[u].size(); i++) {
    int v = ga[u][i];
    if (!vis[v]) dfs(v);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    ga[y].push_back(x);
    ga[x].push_back(y);
  }
  dfs(1);
  if (n != m) {
    cout << "NO" << endl;
    return 0;
  } else {
    if (n < 3) {
      cout << "NO" << endl;
      return 0;
    }
    for (int i = 1; i <= n; i++) {
      if (!vis[i]) {
        cout << "NO" << endl;
        return 0;
      }
    }
    cout << "FHTAGN!" << endl;
  }
  return 0;
}
