#include <bits/stdc++.h>
using namespace std;
const long long N = 105;
const long long INF = 100000000000;
const long long mod = 1000000007;
long long parent[N];
void pre() {
  for (int i = 0; i < N; i++) parent[i] = i;
}
long long root(long long v) {
  return parent[v] = (v == parent[v]) ? v : root(parent[v]);
}
void solve() {
  long long n, m, x, y, sx, sy, z, fx, fy;
  pre();
  cin >> n >> m;
  int cnt = 0;
  while (m--) {
    cin >> x >> y;
    int rootx = root(x);
    int rooty = root(y);
    if (rootx == rooty)
      cnt++;
    else {
      parent[rooty] = rootx;
    }
  }
  int cnt1 = 0;
  for (int i = 1; i <= n; i++) {
    if (parent[i] == i) {
      cnt1++;
    }
  }
  if (cnt1 == 1 && cnt == 1)
    cout << "FHTAGN!\n";
  else
    cout << "NO\n";
}
int main() {
  int t;
  t = 1;
  while (t--) solve();
  return 0;
}
