#include <bits/stdc++.h>
using namespace std;
vector<long long> v[1005];
bool vis[1005];
void dfs(long long s) {
  vis[s] = 1;
  for (auto i : v[s]) {
    if (vis[i]) continue;
    dfs(i);
  }
}
int main() {
  long long n, m, flag = 1;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1);
  if (n != m) flag = 0;
  for (int i = 1; i <= n; i++)
    if (!vis[i]) flag = 0;
  if (flag)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
