#include <bits/stdc++.h>
using namespace std;
vector<int> mp[105];
int vis[105];
struct node {
  int fa;
  int kid;
  node(int fa, int b) {
    this->fa = fa;
    kid = b;
  }
};
bool bfs(int rt, int n) {
  queue<node> q;
  q.push(node(-1, rt));
  vis[rt] = 1;
  while (!q.empty()) {
    int now = q.front().kid;
    int fa = q.front().fa;
    q.pop();
    for (int i = 0; i < mp[now].size(); i++) {
      int v = mp[now][i];
      if (vis[v] && v != fa) {
        vis[v]++;
        continue;
      }
      if (vis[v] || v == fa) continue;
      vis[v] = 1;
      q.push(node(now, v));
    }
  }
  int f = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i] > 2) return false;
    if (vis[i] == 2) f = 1;
  }
  if (f) return true;
  return false;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    mp[u].push_back(v);
    mp[v].push_back(u);
  }
  int yes = 0;
  int no = 0;
  for (int i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      if (bfs(i, n)) {
        yes++;
      } else {
        no = 1;
      }
    }
  }
  if (yes == 1 && no == 0)
    puts("FHTAGN!");
  else
    puts("NO");
}
