#include <bits/stdc++.h>
using namespace std;
vector<int> edges[105];
bool visited[105];
int cnt;
int cycle;
void dfs(int cur, int pre) {
  visited[cur] = 1;
  ++cnt;
  int nxt;
  for (int i = 0; i < edges[cur].size(); ++i) {
    nxt = edges[cur][i];
    if (nxt == pre) continue;
    if (visited[nxt]) {
      ++cycle;
    } else
      dfs(nxt, cur);
  }
}
int main() {
  int n, m;
  int u, v;
  while (cin >> n >> m) {
    for (int i = 0; i < m; ++i) {
      cin >> u >> v;
      edges[u].push_back(v);
      edges[v].push_back(u);
    }
    cnt = 0;
    cycle = 0;
    dfs(1, -1);
    if (cnt != n || cycle != 2)
      cout << "NO\n";
    else
      cout << "FHTAGN!\n";
    for (int i = 1; i <= n; ++i) edges[i].clear();
  }
  return 0;
}
