#include <bits/stdc++.h>
using namespace std;
int n, m, flag;
long long val[105];
vector<int> gra[105];
int dfn[105], low[105], now;
void dfs(int s, int f) {
  dfn[s] = low[s] = ++now;
  for (int i = 0; i < gra[s].size(); i++) {
    int e = gra[s][i];
    if (e == f) continue;
    if (dfn[e]) {
      flag++;
    } else
      dfs(e, s);
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= n; i++) gra[i].clear();
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    gra[a].push_back(b);
    gra[b].push_back(a);
  }
  memset(dfn, 0, sizeof(dfn));
  now = flag = 0;
  for (int i = 1; i <= n; i++)
    if (!dfn[i]) {
      if (i != 1) {
        flag = -1;
        break;
      }
      dfs(i, -1);
    }
  if (flag == 2)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
