#include <bits/stdc++.h>
using namespace std;
const long long N = 110;
long long was[N];
vector<long long> g[N];
void dfs(long long x) {
  was[x] = 1;
  for (auto v : g[x]) {
    if (!was[v]) {
      dfs(v);
      was[v] = 1;
    }
  }
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < (m); ++i) {
    long long x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  long long tmp = 0;
  for (long long i = 0; i < (n); ++i) {
    if (!was[i + 1]) {
      dfs(i + 1);
      tmp++;
    }
  }
  if ((tmp == 1) and (n == m))
    cout << "FHTAGN!\n";
  else
    cout << "NO\n";
}
