#include <bits/stdc++.h>
using namespace std;
int n, m;
bool use[105];
vector<int> a[105];
queue<int> q;
void bfs() {
  q.push(0);
  while (!q.empty()) {
    int p = q.front();
    use[p] = 1;
    q.pop();
    for (int i = 0; i < a[p].size(); i++)
      if (!use[a[p][i]]) q.push(a[p][i]);
  }
}
int main() {
  cin >> n >> m;
  if (n != m) {
    cout << "NO" << endl;
    return 0;
  }
  int i, j, x, y;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    x--, y--;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  bfs();
  for (i = 0; i < n; i++)
    if (!use[i]) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "FHTAGN!" << endl;
  return 0;
}
