#include <bits/stdc++.h>
using namespace std;
int pole[105][105];
int stav[105];
int pathFrom[105];
int main() {
  int N, M;
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int x, y;
    cin >> x >> y;
    pole[x][y] = 1;
    pole[y][x] = 1;
  }
  queue<int> OPEN;
  OPEN.push(1);
  stav[1] = 1;
  int Cycle = 0;
  int cnt = 0;
  while (!OPEN.empty()) {
    int current = OPEN.front();
    OPEN.pop();
    for (int i = 1; i <= N; i++) {
      if (pole[current][i] == 1 && pole[current][i] != i) {
        int nei = i;
        if (Cycle == 2 && stav[nei] > 1 && pathFrom[current] != nei) {
          cout << "NO" << endl;
          return 0;
        }
        if (Cycle < 2 && stav[nei] > 1 && pathFrom[current] != nei) {
          Cycle++;
        }
        if (stav[nei] == 0) {
          OPEN.push(nei);
          stav[nei] = 1;
          pathFrom[nei] = current;
        }
      }
    }
    stav[current] = 2;
    cnt++;
  }
  if (cnt != N || Cycle < 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "FHTAGN!" << endl;
  return 0;
}
