#include <bits/stdc++.h>
using namespace std;
vector<int> adj[110];
int componente[110];
void dfs(int s) {
  for (int i = 0; i < adj[s].size(); i++) {
    int e = adj[s][i];
    if (componente[e] == -1) {
      componente[e] = componente[s];
      dfs(e);
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int v1, v2;
    cin >> v1 >> v2;
    adj[v1].push_back(v2);
    adj[v2].push_back(v1);
  }
  int c = 0;
  memset(componente, -1, sizeof(componente));
  ;
  for (int i = 1; i <= n; i++) {
    if (componente[i] == -1) {
      c++;
      componente[i] = i;
      dfs(i);
    }
  }
  if (c == 1 && m == n)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
}
