#include <bits/stdc++.h>
using namespace std;
int n, m;
bool visit[105];
vector<int> Adj[105];
void dfs(int s) {
  visit[s] = true;
  for (int i = 0; i < Adj[s].size(); i++) {
    int to = Adj[s][i];
    if (to != s && !visit[to]) dfs(to);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    Adj[x].push_back(y);
    Adj[y].push_back(x);
  }
  int ct = 0;
  for (int i = 1; i <= n; i++) {
    if (!visit[i]) {
      dfs(i);
      ct++;
    }
  }
  if (ct == 1 && n == m)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
}
