#include <bits/stdc++.h>
using namespace std;
int i, n, m, a, b, c;
int d[105][105];
int check[105];
vector<int> v[105];
void dfs(int idx, int par) {
  check[idx]++;
  n--;
  int j = 0;
  int vsize = v[idx].size();
  int mn, mx;
  for (j = 0; j < vsize; j++) {
    mn = min(v[idx][j], idx);
    mx = max(v[idx][j], idx);
    if (check[v[idx][j]]) {
      if (v[idx][j] != par and d[mn][mx] == 0) {
        c++;
        d[mn][mx] = 1;
      }
    } else
      dfs(v[idx][j], idx);
  }
}
int main() {
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  dfs(1, 0);
  if (c == 1 and n == 0)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
