#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int n, m, k, f[N];
vector<int> v[N];
void dfs(int c) {
  f[c] = true;
  k++;
  for (auto i : v[c])
    if (!f[i]) dfs(i);
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    v[x].push_back(y);
    v[y].push_back(x);
  }
  dfs(1);
  if (k != n || m != n)
    printf("NO");
  else
    printf("FHTAGN!");
  return 0;
}
