#include <bits/stdc++.h>
using namespace std;
int eD[150][150], mark[150], delx, dely, flag, n, m;
int dfs(int x, int rem) {
  mark[x] = 1;
  for (int i = 1; i <= n; i++) {
    if (!eD[x][i] || i == rem) continue;
    if (mark[i]) {
      delx = x;
      dely = i;
      flag = 1;
      return 1;
    } else
      dfs(i, x);
    if (flag) return 1;
  }
  return 0;
}
int main() {
  int x, y;
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> x >> y;
    eD[x][y] = eD[y][x] = 1;
  }
  if (!dfs(1, -1)) {
    puts("NO");
    return 0;
  }
  flag = eD[delx][dely] = eD[dely][delx] = 0;
  memset(mark, 0, sizeof(mark));
  flag = dfs(1, -1);
  for (int i = 1; i <= n; i++)
    if (!mark[i]) {
      flag = 1;
      break;
    }
  if (flag)
    puts("NO");
  else
    puts("FHTAGN!");
  return 0;
}
