#include <bits/stdc++.h>
using namespace std;
void dfs(int node, vector<int> adj[], bool vis[], int &flag, int par) {
  if (vis[node]) return;
  vis[node] = true;
  flag += 1;
  for (auto it : adj[node]) {
    if (!vis[it]) dfs(it, adj, vis, flag, node);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> adj[n + 1];
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  bool vis[n + 1];
  memset(vis, false, sizeof(vis));
  int flag = 0;
  dfs(1, adj, vis, flag, -1);
  bool flag1 = true;
  if (flag != n || m != n)
    cout << "NO";
  else
    cout << "FHTAGN!";
}
