#include <bits/stdc++.h>
using namespace std;
vector<int> x[101];
int vis[101] = {0}, flag = 0;
void dfs(int i, int parent) {
  if (vis[i]) {
    if (vis[i] != parent) flag++;
    return;
  }
  vis[i] = parent;
  for (int j = 0; j < x[i].size(); ++j) {
    if (x[i][j] == parent) continue;
    dfs(x[i][j], i);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int t, t1;
    cin >> t >> t1;
    x[t].push_back(t1);
    x[t1].push_back(t);
  }
  int z = 0;
  if (n != m) {
    cout << "NO";
    return 0;
  }
  for (int i = 1; i <= n; ++i)
    if (!vis[i]) {
      dfs(1, 0);
      ++z;
    }
  if (flag >= 1 && z == 1)
    cout << "FHTAGN!";
  else
    cout << "NO";
  return 0;
}
