#include <bits/stdc++.h>
using namespace std;
bool visit[128] = {false};
bool g[128][128] = {false};
int n, m, cycle;
void dfs(int node) {
  visit[node] = true;
  int i;
  for ((i) = 0; (i) < (int)(n); (i)++) {
    if (!visit[i] && g[node][i]) {
      dfs(i);
    }
  }
}
int main() {
  int a, b, i;
  cin >> n >> m;
  cycle = 0;
  for ((i) = 0; (i) < (int)(m); (i)++) {
    cin >> a >> b;
    a--;
    b--;
    g[a][b] = true;
    g[b][a] = true;
  }
  dfs(0);
  bool flag = true;
  for ((i) = 0; (i) < (int)(n); (i)++)
    if (!visit[i]) flag = false;
  if (flag && m == n)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
