#include <bits/stdc++.h>
using namespace std;
void connected(vector<vector<bool> > chu, vector<bool>& v, int s) {
  v[s] = 1;
  for (int i = 0; i < chu.size(); i++) {
    if (chu[s][i] && !v[i]) {
      connected(chu, v, i);
    }
  }
}
int main() {
  int n, m;
  while (cin >> n >> m) {
    if (n != m) {
      cout << "NO" << endl;
      break;
    }
    vector<vector<bool> > chu(n, vector<bool>(n, 0));
    for (int i = 0; i < m; i++) {
      int e1, e2;
      cin >> e1 >> e2;
      chu[e1 - 1][e2 - 1] = 1;
      chu[e2 - 1][e1 - 1] = 1;
    }
    vector<bool> visisted(n, 0);
    connected(chu, visisted, 0);
    bool allseen = true;
    for (int i = 0; i < visisted.size(); i++) {
      if (!visisted[i]) allseen = false;
    }
    if (allseen) {
      cout << "FHTAGN!" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
