#include <bits/stdc++.h>
using namespace std;
int vis[101];
vector<vector<int>> adj;
void dfs(int s) {
  vis[s] = 1;
  for (int i = 0; i < adj[s].size(); i++)
    if (!vis[adj[s][i]]) dfs(adj[s][i]);
}
int main() {
  int n, m;
  cin >> n >> m;
  if (m != n) {
    cout << "NO\n";
    return 0;
  }
  adj.resize(n + 1);
  int f, t;
  for (int i = 0; i < m; i++) {
    cin >> f >> t;
    adj[f].push_back(t);
    adj[t].push_back(f);
  }
  bool flag = true;
  vector<int> res1;
  memset(vis, 0, sizeof(vis));
  dfs(1);
  for (int j = 1; j <= n; j++)
    if (!vis[j]) {
      flag = false;
      break;
    }
  if (flag)
    cout << "FHTAGN!\n";
  else
    cout << "NO\n";
  return 0;
}
