#include <bits/stdc++.h>
using namespace std;
const int N = 200;
vector<int> adj[N];
int mark[N];
void dfs(int v) {
  mark[v] = 1;
  for (auto u : adj[v])
    if (!mark[u]) dfs(u);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs(0);
  if (n == m && *min_element(mark, mark + n) != 0)
    cout << "FHTAGN!\n";
  else
    cout << "NO\n";
  return 0;
}
