#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100;
int n, m;
struct vertex {
  int parent;
  bool mark;
  vector<int> adj;
} v[MAXN];
inline void INPUT() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    v[a].adj.push_back(b);
    v[b].adj.push_back(a);
  }
}
inline int DFS_VISIT(int u) {
  for (int i = 0; i < v[u].adj.size(); i++) {
    int x = v[u].adj[i];
    if (v[x].mark == 0) {
      v[x].mark = 1;
      v[x].parent = u;
      DFS_VISIT(x);
    }
  }
}
int main() {
  INPUT();
  if (n != m) {
    cout << "NO" << endl;
    return 0;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (v[i].mark == 0) {
      v[i].mark = 1;
      v[i].parent = -1;
      DFS_VISIT(i);
      cnt++;
    }
  }
  if (cnt > 1) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "FHTAGN!" << endl;
  return 0;
}
