#include <bits/stdc++.h>
using namespace std;
int n, m, cnt;
vector<int> e[105];
bool f[105];
void dfs(int x) {
  f[x] = 1, ++cnt;
  for (int i = 0; i < e[x].size(); ++i)
    if (!f[e[x][i]]) dfs(e[x][i]);
}
void work() {
  int i, x, y;
  scanf("%d%d", &n, &m);
  if (n != m) {
    puts("NO");
    return;
  }
  for (i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    e[x].push_back(y);
    e[y].push_back(x);
  }
  dfs(1);
  if (cnt == n)
    puts("FHTAGN!");
  else
    puts("NO");
}
int main() {
  work();
  return 0;
}
