#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const double PI = 3.141592653589793238463;
const int INF = 0x3f3f3f3f;
const int INFS = 1000000000;
const long long LLINF = 9223372036854775807;
const int M = 1000000007;
const double EPS = 1e-9;
const int p = 43;
vector<vector<int> > g(100);
bool used[100];
void dfs(int v) {
  if (used[v]) return;
  used[v] = true;
  for (auto u : g[v]) dfs(u);
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, m, t1, t2;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> t1 >> t2;
    g[t1 - 1].push_back(t2 - 1);
    g[t2 - 1].push_back(t1 - 1);
  }
  if (n != m) {
    cout << "NO" << endl;
    return 0;
  }
  bool ok = true;
  dfs(0);
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      ok = false;
      break;
    }
  }
  if (ok)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
