#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 1000;
const long long INF64 = 1e18;
const int N = 4e5 + 1000;
const int MOD = 998244353;
const double EPS = 1E-9;
const double PI = acos(-1.);
vector<vector<int>> g(1000);
long long gcd(long long a, long long b) { return a == 0 ? b : gcd(b % a, a); }
set<int> used;
void dfs(int v, int p) {
  used.insert(v);
  for (auto to : g[v]) {
    if (used.count(to) == 0) dfs(to, v);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  dfs(1, 1);
  if (used.size() == n && n == m)
    cout << "FHTAGN!";
  else
    cout << "NO\n";
}
