#include <bits/stdc++.h>
using namespace std;
vector<long long> graph[105];
bool vis[105];
void dfs(long long node) {
  vis[node] = true;
  for (auto child : graph[node]) {
    if (vis[child] == false) dfs(child);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  clock_t clk = clock();
  long long n, m;
  cin >> n >> m;
  for (long long i = 1; i <= m; i++) {
    long long a, b;
    cin >> a >> b;
    graph[a].push_back(b);
    graph[b].push_back(a);
  }
  memset(vis, false, sizeof(vis));
  dfs(1);
  long long cnt = 0;
  for (long long i = 1; i <= n; i++) {
    if (!vis[i]) cnt++;
  }
  if (cnt > 0 || n != m)
    cout << "NO" << '\n';
  else
    cout << "FHTAGN!" << '\n';
  cerr << "Time (in ms): " << double(clock() - clk) * 1000.0 / CLOCKS_PER_SEC
       << '\n';
}
