#include <bits/stdc++.h>
using namespace std;
const int MAX = 105;
int P[MAX], N, M;
int Find(int a) {
  if (P[a] == -1) return a;
  return (P[a] = Find(P[a]));
}
void Union(int a, int b) {
  int x = Find(a), y = Find(b);
  if (x != y) {
    P[x] = y;
  }
}
int main() {
  cin >> N >> M;
  for (int i = 0; i < N; i++) {
    P[i] = -1;
  }
  for (int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    Union(a, b);
  }
  if (N != M) {
    cout << "NO\n";
    return 0;
  }
  int c = Find(0);
  for (int i = 0; i < N; i++) {
    if (c != Find(i)) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "FHTAGN!\n";
}
