#include <bits/stdc++.h>
using namespace std;
const int maxn = 110;
int n, m;
int fa[maxn];
bool vis[maxn];
int findset(int x) { return fa[x] == -1 ? x : fa[x] = findset(fa[x]); }
int Bind(int u, int v) {
  int fu = findset(u);
  int fv = findset(v);
  if (fu != fv) {
    fa[fu] = fv;
    return 1;
  }
  return 0;
}
int main() {
  cin >> n >> m;
  memset(fa, -1, sizeof fa);
  int num = n;
  bool f = true, ff = true;
  while (m--) {
    int u, v;
    cin >> u >> v;
    int tmp = Bind(u, v);
    num -= tmp;
    if (tmp == 0) {
      if (ff) {
        ff = false;
      } else
        f = false;
    }
  }
  if (num != 1 || !f || ff)
    cout << "NO" << endl;
  else
    cout << "FHTAGN!" << endl;
  return 0;
}
