#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> g[100000];
bool used[100000];
void dfs(int v) {
  used[v] = true;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (used[to] == false) {
      dfs(to);
    }
  }
}
int main() {
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int l, r;
    cin >> l >> r;
    g[l].push_back(r);
    g[r].push_back(l);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (used[i] == false) {
      cout << "NO";
      return 0;
    }
  }
  if (n == m) {
    cout << "FHTAGN!";
    return 0;
  }
  cout << "NO";
}
