#include <bits/stdc++.h>
using namespace std;
int fp(int abc, int parent[]) {
  if (parent[abc] == abc) return abc;
  int def = fp(parent[abc], parent);
  parent[abc] = def;
  return def;
}
void cycledmerge(vector<int> hub[], int n, int parent[]) {
  stack<int> urutan;
  for (int i = 0; i < n; i++) parent[i] = i;
  stack<pair<int, int> > ngurut;
  vector<int> sudah(n, 0);
  vector<int> adadiurutan(n, 0);
  vector<int> dari(n, -1);
  for (int i = 0; i < n; i++) {
    if (sudah[i]) continue;
    urutan.push(i);
    ngurut.push(make_pair(i, 0));
    adadiurutan[i] = 1;
    sudah[i] = 1;
    while (!ngurut.empty()) {
      int id = ngurut.top().first;
      int val = ngurut.top().second;
      ngurut.pop();
      if (val == (int)hub[id].size()) {
        while (!urutan.empty() && urutan.top() == id) urutan.pop();
        adadiurutan[id] = 0;
        continue;
      }
      ngurut.push(make_pair(id, val + 1));
      int next = hub[id][val];
      if (dari[id] == next) continue;
      if (sudah[next] && !adadiurutan[fp(next, parent)]) continue;
      if (!sudah[next]) {
        sudah[next] = 1;
        urutan.push(next);
        ngurut.push(make_pair(next, 0));
        adadiurutan[next] = 1;
        dari[next] = id;
        continue;
      }
      if (parent[fp(id, parent)] == fp(next, parent)) continue;
      parent[fp(id, parent)] = fp(next, parent);
      while (!urutan.empty() && urutan.top() != fp(next, parent)) {
        parent[fp(urutan.top(), parent)] = fp(next, parent);
        urutan.pop();
      }
    }
  }
  return;
}
int main() {
  int p[200];
  vector<int> hub[200];
  int n, m;
  cin >> n >> m;
  for (int(i) = 0; (i) < (m); ++(i)) {
    int a, b;
    cin >> a >> b;
    --a;
    --b;
    hub[a].push_back(b);
    hub[b].push_back(a);
  }
  cycledmerge(hub, n, p);
  vector<int> ukuran(n, 0);
  for (int(i) = 0; (i) < (n); ++(i)) ukuran[p[i]]++;
  int numcyc = 0;
  for (int(i) = 0; (i) < (n); ++(i))
    if (ukuran[i] >= 3) ++numcyc;
  if (numcyc != 1) {
    cout << "NO" << endl;
    return 0;
  }
  int besar = 0;
  for (int(i) = 0; (i) < (n); ++(i))
    if (ukuran[i] >= 3) besar = ukuran[i];
  int yesadj = 0;
  int noadj = 0;
  for (int(i) = 0; (i) < (n); ++(i))
    for (int(j) = 0; (j) < (((int)hub[i].size())); ++(j)) {
      int k = hub[i][j];
      if (k < i) continue;
      if (p[i] != p[k])
        ++noadj;
      else
        ++yesadj;
    }
  if (yesadj != besar || noadj != (n - besar + 1) - 1) {
    cout << "NO" << endl;
  } else {
    cout << "FHTAGN!" << endl;
  }
  return 0;
}
