#include <bits/stdc++.h>
using namespace std;
long long n, m, st = -1, en = -1, c = 0, t = 0;
vector<long long> ad[105];
map<long long, long long> vis, p;
void dfs(long long i, long long pa = 0) {
  p[i] = pa;
  t++;
  vis[i] = 1;
  for (auto x : ad[i]) {
    if (x == pa) continue;
    if (vis[x]) {
      c++;
    } else
      dfs(x, i);
  }
}
void solve() {
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long x, y;
    cin >> x >> y;
    ad[x].push_back(y);
    ad[y].push_back(x);
  }
  dfs(1);
  c = c / 2;
  if (c > 1 || c == 0 || t < n)
    cout << "NO";
  else
    cout << "FHTAGN!";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long TESTS = 1;
  while (TESTS--) {
    solve();
  }
  return 0;
}
