#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<int> > adj;
bool visi[300];
int back;
void dfs(int u, int p) {
  visi[u] = true;
  for (int i = 0; i < (int)(int((adj[u]).size())); i++) {
    int v = adj[u][i];
    if (v == p) continue;
    if (visi[v]) {
      back++;
    } else
      dfs(v, u);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  adj = vector<vector<int> >(n, vector<int>());
  int u, v;
  for (int i = 0; i < (int)(m); i++) {
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(0, 0);
  if (back != 2) {
    cout << "NO" << endl;
    return 0;
  }
  for (int i = 0; i < (int)(n); i++)
    if (!visi[i]) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "FHTAGN!" << endl;
  return 0;
}
