#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T Get_Max(const T& a, const T& b) {
  return a < b ? b : a;
}
template <class T>
inline T Get_Min(const T& a, const T& b) {
  return a < b ? a : b;
}
const int maxn = 110;
vector<int> G[maxn];
int mark[maxn];
int dfs(int u) {
  int cnt = 0;
  if (mark[u])
    return 0;
  else {
    mark[u] = 1;
    cnt++;
    for (int i = 0; i < G[u].size(); i++) {
      cnt += dfs(G[u][i]);
    }
  }
  return cnt;
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    G[u].push_back(v);
    G[v].push_back(u);
  }
  memset(mark, 0, sizeof mark);
  if (n == m && dfs(1) == n)
    printf("FHTAGN!\n");
  else
    printf("NO\n");
  return 0;
}
