#include <bits/stdc++.h>
using namespace std;
int table[105][105];
int used[105];
int N, M;
int cycle = 0;
int visit[105];
void DFS(int from, int s) {
  int i, j, k;
  for (i = 1; i <= N; i++) {
    if (table[s][i] && i != from && !visit[i]) {
      if (used[i]) {
        cycle++;
      } else {
        used[i] = 1;
        DFS(s, i);
        used[i] = 0;
      }
    }
  }
  visit[s] = 1;
}
int main() {
  int i, j, k;
  int temp1, temp2;
  cin >> N >> M;
  for (i = 0; i < M; i++) {
    cin >> temp1 >> temp2;
    table[temp1][temp2] = table[temp2][temp1] = 1;
  }
  int COM = 0;
  used[1] = 1;
  DFS(0, 1);
  for (i = 1; i <= N; i++) {
    if (visit[i]) COM++;
  }
  if (COM != N || cycle != 1) {
    cout << "NO";
  } else {
    cout << "FHTAGN!";
  }
  return 0;
}
