#include <bits/stdc++.h>
using namespace std;
int n, m;
int parent[110];
int ranks[110];
int visit[110];
int cycle = 0;
int Findset(int i) {
  int root = i;
  while (root != parent[root]) root = parent[root];
  while (i != root) {
    int newp = parent[i];
    parent[i] = root;
    i = newp;
  }
  return root;
}
void Unionset(int x, int y) {
  int xp = Findset(x);
  int yp = Findset(y);
  if (xp == yp)
    cycle++;
  else {
    if (ranks[xp] < ranks[yp])
      parent[xp] = yp;
    else if (ranks[xp] > ranks[yp])
      parent[yp] = xp;
    else {
      parent[yp] = xp;
      ranks[xp]++;
    }
  }
}
int main() {
  memset(visit, false, sizeof(visit));
  for (int i = 0; i < 110; i++) {
    parent[i] = i;
    ranks[i] = -1;
  }
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    visit[x] = visit[y] = true;
    Unionset(x, y);
  }
  for (int i = 1; i <= n; i++) {
    if (!visit[i]) {
      printf("NO");
      return 0;
    }
  }
  if (cycle == 1)
    printf("FHTAGN!");
  else
    printf("NO");
  return 0;
}
