#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}
vector<vector<long long>> v(101);
bool vis[102] = {false};
void dfs(long long i) {
  vis[i] = true;
  for (auto a : v[i]) {
    if (!vis[a]) dfs(a);
  }
}
void mysol() {
  long long n, m;
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  long long ans = 0;
  dfs(1);
  bool fg = false;
  for (long long i = 1; i <= n; i++)
    if (!vis[i]) fg = true;
  if ((m == n) && !fg)
    cout << "FHTAGN!\n";
  else
    cout << "NO\n";
}
int32_t main() {
  fast();
  { mysol(); }
  return 0;
}
