#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int counter = 0;
int root[N];
int size[N];
int find(int u) {
  if (u == root[u]) return u;
  return root[u] = find(root[u]);
}
int main() {
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    root[i] = i;
    size[i] = 1;
  }
  while (m--) {
    scanf("%d%d", &x, &y);
    x = find(x);
    y = find(y);
    if (x == y)
      counter++;
    else {
      root[x] = y;
      size[y] += size[x];
    }
  }
  puts((counter == 1 && size[find(root[1])] == n) ? "FHTAGN!" : "NO");
  return 0;
}
