#include <bits/stdc++.h>
using namespace std;
vector<int> g[101];
int n, m;
bool visited[101];
void dfs(int v) {
  visited[v] = true;
  for (int i = 0; i < g[v].size(); i++) {
    if (!visited[g[v][i]]) dfs(g[v][i]);
  }
}
bool isConnected() {
  fill(visited, visited + n, false);
  dfs(0);
  for (int i = 0; i < n; i++)
    if (!visited[i]) return false;
  return true;
}
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--, y--;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  if (n == m && isConnected())
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
