#include <bits/stdc++.h>
const int maxn = 105;
int n, m, fa[maxn], cnt;
bool flag;
inline int find(int x) {
  if (fa[x] != x) fa[x] = find(fa[x]);
  return fa[x];
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) fa[i] = i;
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    int fx = find(u), fy = find(v);
    if (fx != fy) {
      fa[fy] = fx;
      cnt++;
    } else {
      if (flag) {
        printf("NO\n");
        return 0;
      }
      flag = 1;
      cnt++;
    }
  }
  if (flag && cnt == n) {
    printf("FHTAGN!");
  } else
    printf("NO\n");
  return 0;
}
