#include <bits/stdc++.h>
using namespace std;
const int sz = 1e6 + 10;
using ll = long long;
int n, m;
int par[105];
set<int> st;
int find_rep(int x) { return par[x] == x ? par[x] : par[x] = find_rep(par[x]); }
int main() {
  while (scanf("%d %d", &n, &m) == 2) {
    for (int i = 0; i <= n; i++) par[i] = i;
    for (int i = 0, x, y; i < m; i++) {
      cin >> x >> y;
      if ((x = find_rep(x)) != (y = find_rep(y))) par[x] = par[y];
    }
    for (int i = 1; i <= n; i++) st.insert(find_rep(i));
    if (n == m && st.size() == 1)
      cout << "FHTAGN!\n";
    else
      cout << "NO\n";
    cerr << "-------------\n";
  }
  return 0;
}
