#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
bool check[maxn] = {false};
vector<vector<int> > edge(maxn);
stack<int> s;
void DFS(int x) {
  check[x] = true;
  s.push(x);
  bool ok = 0;
  while (!s.empty()) {
    int head = s.top();
    s.pop();
    for (auto itr1 : edge[head]) {
      if (!check[itr1]) {
        check[itr1] = true;
        s.push(itr1);
      }
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  DFS(1);
  bool ok = 1;
  for (int i = 1; i <= n; i++) {
    if (!check[i]) {
      ok = 0;
    }
  }
  cout << ((ok and m == n) ? "FHTAGN!" : "NO");
  return 0;
}
