#include <bits/stdc++.h>
std::vector<int> adj[100];
bool cycle = false;
bool adding = false;
int color[100];
std::vector<int> cyc;
bool on_cyc[100];
void dfs1(int v, int p) {
  if (color[v] == 1) {
    cycle = true;
    adding = true;
    cyc.push_back(v);
    return;
  }
  color[v] = 1;
  for (int u : adj[v]) {
    if (u == p) continue;
    dfs1(u, v);
    if (cycle) {
      if (adding) {
        if (v == cyc[0])
          adding = false;
        else
          cyc.push_back(v);
      }
      return;
    }
  }
  color[v] = 2;
}
bool visited[100];
int cur_root;
bool dfs2(int v, int p) {
  if (visited[v]) return false;
  visited[v] = true;
  for (int u : adj[v]) {
    if (u == p) continue;
    if (on_cyc[u] && v == cur_root) continue;
    if (!dfs2(u, v)) return false;
  }
  return true;
}
bool visited2[100];
int cnt(int v, int p) {
  if (visited2[v]) return 0;
  visited2[v] = true;
  int ans = 1;
  for (int u : adj[v]) {
    if (u == p) continue;
    ans += cnt(u, v);
  }
  return ans;
}
int main() {
  int n, m;
  std::cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int x, y;
    std::cin >> x >> y;
    x--;
    y--;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  if (cnt(0, -1) != n) {
    std::cout << "NO\n";
    return 0;
  }
  dfs1(0, -1);
  if (cycle) {
    for (int v : cyc) on_cyc[v] = true;
    bool ok = true;
    for (int v : cyc) {
      cur_root = v;
      if (!dfs2(v, -1)) {
        ok = false;
        break;
      }
    }
    std::cout << (ok ? "FHTAGN!" : "NO") << '\n';
  } else {
    std::cout << "NO\n";
  }
  return 0;
}
