#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 444;
vector<int> graph[MAX_N];
bool was[MAX_N];
void dfs(int u) {
  was[u] = true;
  for (int i = 0; i < graph[u].size(); i++) {
    int to = graph[u][i];
    if (!was[to]) dfs(to);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  int n, m;
  int u, v;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    graph[u].push_back(v);
    graph[v].push_back(u);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (!was[i]) {
      cout << "NO";
      return 0;
    }
  }
  if (n != m)
    cout << "NO";
  else
    cout << "FHTAGN!";
  return 0;
}
