#include <bits/stdc++.h>
using namespace std;
int n, m;
int f[103];
int find(int x) {
  if (x == f[x]) return x;
  return f[x] = find(f[x]);
}
void up(int x, int y) {
  int fx = find(x);
  int fy = find(y);
  f[fx] = fy;
}
int main() {
  while (~scanf("%d%d", &n, &m)) {
    for (int i = 1; i <= n; i++) f[i] = i;
    int x, y;
    for (int i = 0; i < m; i++) {
      scanf("%d%d", &x, &y);
      if (find(x) != find(y)) up(x, y);
    }
    int flag = 0;
    if (n != m) flag = 1;
    for (int i = 2; i <= n; i++)
      if (find(1) != find(i)) {
        flag = 1;
        break;
      }
    if (flag)
      printf("NO\n");
    else
      printf("FHTAGN!\n");
  }
}
