#include <bits/stdc++.h>
using namespace std;
const int MAXN = 110;
vector<int> g[MAXN];
int inCycle;
int cycleHead;
vector<int> cycle;
bool isIn[MAXN];
bool mark[MAXN];
int nodeCount;
void dfs0(int u) {
  mark[u] = true;
  nodeCount++;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (!mark[v]) dfs0(v);
  }
}
void dfs(int u, int par) {
  mark[u] = true;
  for (int i = 0; i < g[u].size() && !inCycle; i++) {
    int v = g[u][i];
    if (v == par) continue;
    if (!mark[v])
      dfs(v, u);
    else {
      cycleHead = v;
      inCycle = 1;
      break;
    }
  }
  if (inCycle == 1) {
    if (cycleHead == u) inCycle = 2;
    isIn[u] = true;
  }
}
bool isGood = true;
void dfs2(int u, int par) {
  mark[u] = true;
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    if (v == par || isIn[v]) continue;
    if (mark[v])
      isGood = false;
    else
      dfs2(v, u);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs0(0);
  memset(mark, 0, sizeof mark);
  dfs(0, -1);
  int s = 0;
  for (int i = 0; i < n; i++)
    if (isIn[i]) {
      s++;
      int d = 0;
      for (int j = 0; j < g[i].size(); j++) d += isIn[g[i][j]];
      if (d != 2) {
        cout << "NO" << endl;
        return 0;
      }
    }
  memset(mark, 0, sizeof mark);
  for (int i = 0; i < n; i++)
    if (isIn[i]) dfs2(i, -1);
  if (s < 3 || nodeCount != n) isGood = false;
  if (isGood)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
