#include <bits/stdc++.h>
const int magicconst = 73743071;
using namespace std;
bool b[105];
bool c[105][105];
int n, m;
void dfs(int v) {
  if (b[v]) return;
  b[v] = 1;
  for (int i = 0; i < (int)(n); ++i)
    if (c[v][i]) dfs(i);
}
int main() {
  scanf("%d%d", &n, &m);
  if (n != m) {
    printf("NO");
    return 0;
  }
  memset(c, 0, sizeof c);
  for (int i = 0; i < (int)(m); ++i) {
    int q, w;
    scanf("%d%d", &q, &w);
    c[q - 1][w - 1] = c[w - 1][q - 1] = 1;
  }
  memset(b, 0, sizeof b);
  dfs(0);
  for (int i = 0; i < (int)(n); ++i) {
    if (!b[i]) {
      printf("NO");
      return 0;
    }
  }
  printf("FHTAGN!");
  return 0;
}
