#include <bits/stdc++.h>
using namespace std;
int cycle = 0;
bool single = true;
struct graph {
  vector<int> adj;
  bool isBlack;
  graph(void) { isBlack = false; }
};
void dfs(graph G[], int index, int CB);
int main(void) {
  int n, m;
  graph G[106];
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    G[u].adj.push_back(v);
    G[v].adj.push_back(u);
  }
  dfs(G, 1, 0);
  for (int i = 1; i <= n; i++) {
    if (!G[i].isBlack) {
      single = false;
    }
  }
  string ans;
  if (cycle == 2 && single)
    ans = string("FHTAGN!\n");
  else
    ans = string("NO\n");
  cout << ans;
  return 0;
}
void dfs(graph G[], int index, int CB) {
  vector<int>& adj = G[index].adj;
  int size = adj.size();
  G[index].isBlack = true;
  for (int i = 0; i < size; i++) {
    if (!G[adj[i]].isBlack) {
      dfs(G, adj[i], index);
    } else if (G[adj[i]].isBlack && adj[i] != CB) {
      cycle++;
    }
  }
  return;
}
