#include <bits/stdc++.h>
using namespace std;
const int maxN = 100 + 10;
int n, m;
vector<int> adj[maxN];
bool mark[maxN], flag;
void dfs(int v) {
  mark[v] = true;
  for (int i = 0; i < (int)adj[v].size(); i++) {
    int u = adj[v][i];
    if (!mark[u]) dfs(u);
  }
  return;
}
void dfsAll() {
  for (int i = 0; i < n; i++) {
    if (!mark[i]) flag = true;
  }
  return;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    v--;
    u--;
    adj[v].push_back(u);
    adj[u].push_back(v);
  }
  dfs(0);
  dfsAll();
  if (flag || n != m)
    cout << "NO";
  else
    cout << "FHTAGN!";
  cout << endl;
  return 0;
}
