#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  int t = 1;
  while (t--) solve();
  return 0;
}
int n, m;
vector<int> e[200];
bool be[200];
void dfs1(int v, int beg = -1, int end = -1) {
  be[v] = true;
  for (int i = 0; i < e[v].size(); i++)
    if ((v != beg || e[v][i] != end) && (v != end || e[v][i] != beg))
      if (!be[e[v][i]]) dfs1(e[v][i], beg, end);
}
vector<pair<int, int> > nemost;
void solve() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int q, w;
    cin >> q >> w;
    e[q - 1].push_back(w - 1);
    e[w - 1].push_back(q - 1);
  }
  dfs1(0);
  for (int i = 0; i < n; i++)
    if (!be[i]) {
      cout << "NO";
      return;
    }
  memset(be, false, sizeof(be));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < e[i].size(); j++)
      if (i < e[i][j]) {
        bool flag = true;
        dfs1(0, i, e[i][j]);
        for (int k = 0; k < n; k++)
          if (!be[k]) {
            flag = false;
            break;
          }
        if (flag) nemost.push_back(make_pair(i, e[i][j]));
        memset(be, false, sizeof(be));
      }
  int r = nemost.size();
  int step[200];
  memset(step, 0, sizeof(step));
  for (int i = 0; i < r; i++) {
    step[nemost[i].first]++;
    step[nemost[i].second]++;
  }
  if (nemost.size() < 3) {
    cout << "NO";
    return;
  }
  for (int i = 0; i < n; i++)
    if (step[i] != 0 && step[i] != 2) {
      cout << "NO";
      return;
    }
  cout << "FHTAGN!";
}
