#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, f, g, n, m, k, t, p, x, h, w, q;
long long curr = 1;
long long mod = 998244353;
int dsu[109];
int find_parent(int v1) {
  if (dsu[v1] == v1) return v1;
  return dsu[v1] = find_parent(dsu[v1]);
}
void solve() {
  cin >> n >> m;
  int cycles = 0;
  for (int i = 1; i <= n; i++) dsu[i] = i;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a = find_parent(a);
    b = find_parent(b);
    if (a == b) {
      cycles++;
    } else {
      dsu[b] = dsu[a];
    }
  }
  set<int> comps;
  for (int i = 1; i <= n; i++) {
    comps.insert(find_parent(i));
  }
  if (cycles == 1 && comps.size() == 1) {
    cout << "FHTAGN!";
  } else {
    cout << "NO";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int cases = 1;
  while (cases--) {
    solve();
  }
  return 0;
}
