#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > G;
vector<int> was;
int cycle;
void pdfs(int node, int par) {
  was[node]++;
  for (int i = 0; i < G[node].size(); i++) {
    int ch = G[node][i];
    if (was[ch] && ch != par) cycle++;
    if (!was[ch]) pdfs(ch, node);
  }
}
int main() {
  int N, M;
  cin >> N >> M;
  G.resize(N + 2);
  was.resize(N + 2);
  for (int i = 0; i < M; i++) {
    int x, y;
    cin >> x >> y;
    G[x].push_back(y);
    G[y].push_back(x);
  }
  pdfs(1, -1);
  bool con = true;
  for (int i = 1; i <= N; i++)
    if (!was[i]) con = false;
  if (cycle == 2 && con)
    puts("FHTAGN!\n");
  else
    puts("NO\n");
  return 0;
}
