#include <bits/stdc++.h>
using namespace std;
int mark[10000];
vector<int> adj[10000];
void dfs(int pos) {
  if (mark[pos] == 1)
    return;
  else {
    mark[pos] = 1;
    for (int i = 0; i < adj[pos].size(); i++) dfs(adj[pos][i]);
  }
}
int main() {
  memset(mark, -1, sizeof mark);
  int m, n;
  cin >> m >> n;
  for (int i = 0; i < n; i++) {
    int p, q;
    cin >> p >> q;
    p--;
    q--;
    adj[p].push_back(q);
    adj[q].push_back(p);
  }
  if (m != n) {
    cout << "NO" << endl;
    return 0;
  }
  dfs(0);
  for (int i = 0; i < m; i++) {
    if (mark[i] != 1) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "FHTAGN!" << endl;
}
