#include <bits/stdc++.h>
using namespace std;
const int MAX = 100 + 10;
bool a[MAX][MAX];
bool mark[MAX];
int n, m;
void dfs(int u) {
  mark[u] = 1;
  for (int i = 0; i < n; i++)
    if (!mark[i] && a[u][i]) {
      mark[i] = 1;
      dfs(i);
    }
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    u--;
    v--;
    a[u][v] = 1;
    a[v][u] = 1;
  }
  if (n - m) {
    cout << "NO" << endl;
    return 0;
  }
  dfs(0);
  bool p = true;
  for (int i = 0; i < n; i++)
    if (!mark[i]) {
      p = false;
      break;
    }
  if (p)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
