#include <bits/stdc++.h>
using namespace std;
int m, n, s;
bool vis[102];
vector<int> q[102];
void dfs(int a) {
  vis[a] = true;
  s++;
  for (int i = 0; i < q[a].size(); i++)
    if (vis[q[a][i]] == false) dfs(q[a][i]);
}
int main() {
  cin >> n >> m;
  int r1, r2;
  for (int i = 0; i < m; i++) {
    cin >> r1 >> r2;
    q[r1].push_back(r2);
    q[r2].push_back(r1);
  }
  if (n != m) {
    cout << "NO" << endl;
    return 0;
  }
  dfs(1);
  if (s == n)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
