#include <bits/stdc++.h>
using namespace std;
const long long OO = (long long)1e15 + 1;
const int MAX = 1e5 + 5;
vector<vector<int> > adjLst;
int n, m, vis[101], countt = 0, x, y;
void dfs(int cur = 1) {
  if (vis[cur]) return;
  vis[cur] = 1;
  for (int i = 0; i < adjLst[cur].size(); i++) {
    int child = adjLst[cur][i];
    if (!vis[child]) {
      countt++;
      dfs(child);
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  adjLst.resize(n + 1);
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    adjLst[x].push_back(y);
    adjLst[y].push_back(x);
  }
  dfs();
  if (countt != m - 1) return cout << "NO\n", 0;
  for (int i = 1; i < n + 1; i++)
    if (!vis[i]) return cout << "NO\n", 0;
  cout << "FHTAGN!\n";
}
