#include <bits/stdc++.h>
using namespace std;
int A[105][105];
int used[105];
int n;
int dfs(int node, int prev) {
  if (used[node] == 1) return 1;
  used[node] = 1;
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    if (A[node][i] && used[i] != 2 && i != prev) cnt += dfs(i, node);
  used[node] = 2;
  return cnt;
}
int main() {
  int m, i, j, i1, i2;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> i1 >> i2;
    A[i1][i2] = A[i2][i1] = 1;
  }
  int res = dfs(1, -1);
  for (i = 1; i <= n; i++) {
    if (!used[i]) {
      puts("NO");
      return 0;
    }
  }
  cout << (res == 1 ? "FHTAGN!" : "NO") << endl;
}
