#include <bits/stdc++.h>
using namespace std;
int ans = 0;
int a = 0;
vector<int> v[101];
int visited[101];
int parent[101];
void dsf(int s) {
  visited[s] = 1;
  for (int n = 0; n < v[s].size(); n++) {
    int d = v[s][n];
    if (parent[s] != d && visited[d] != 2) {
      if (visited[d] == 1) {
        ans++;
      } else {
        visited[d] = 1;
        parent[d] = s;
        dsf(d);
      }
    }
  }
  visited[s] = 2;
}
int main() {
  int n, e;
  cin >> n >> e;
  int s, d;
  for (int m = 0; m < e; m++) {
    cin >> s >> d;
    v[s].push_back(d);
    v[d].push_back(s);
  }
  for (int m = 1; m <= n; m++) {
    if (visited[m] == 0) {
      parent[m] = m;
      dsf(m);
      a++;
    }
  }
  if (a == 1 && ans == 1)
    cout << "FHTAGN!";
  else
    cout << "NO";
  return 0;
}
