#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int inf = 1e9 + 1;
const double eps = 1e-15;
const double EPS = 1e-9;
const double PI = acos(-1.0);
vector<int> edge[200];
int vis[200];
int n, m, u, v;
void dfs(int id) {
  vis[id] = 1;
  for (int i = 0; i < edge[id].size(); i++) {
    int x = edge[id][i];
    if (!vis[x]) {
      dfs(x);
    }
  }
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> u >> v;
    edge[u].push_back(v);
    edge[v].push_back(u);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cnt++;
      dfs(i);
    }
  }
  (cnt > 1 || n != m) ? cout << "NO\n" : cout << "FHTAGN!\n";
  return 0;
}
