#include <bits/stdc++.h>
using namespace std;
long long visited[100010];
vector<long long> g[100010];
void dfs(long long u) {
  visited[u] = true;
  for (auto x : g[u]) {
    if (!visited[x]) {
      dfs(x);
    }
  }
}
void solve() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; ++i) {
    long long a, b;
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  long long c = 0;
  for (long long i = 1; i <= n; i++)
    if (!visited[i]) c++, dfs(i);
  if (n == m and c == 1)
    cout << "FHTAGN!" << '\n';
  else
    cout << "NO" << '\n';
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  long long t = 1;
  while (t--) solve();
  return 0;
}
