#include <bits/stdc++.h>
const int N = 100 + 10;
int fa[N];
int find(int x) {
  if (fa[x] != x) fa[x] = find(fa[x]);
  return fa[x];
}
void Union(int x, int y) {
  x = find(x);
  y = find(y);
  fa[x] = y;
}
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) fa[i] = i;
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &x, &y);
    Union(x, y);
  }
  if (n != m) {
    puts("NO");
  } else {
    bool f = true;
    for (int i = 2; i <= n; ++i)
      if (find(1) != find(i)) {
        f = false;
        break;
      }
    if (f)
      puts("FHTAGN!");
    else
      puts("NO");
  }
  return 0;
}
