#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> vec[150];
bool vis[150];
int cycles;
int cnt;
void dfs(int node, int parent) {
  if (vis[node]) {
    cycles++;
    return;
  }
  vis[node] = 1;
  cnt++;
  for (auto e : vec[node]) {
    if (e != parent) dfs(e, node);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    vec[a].push_back(b);
    vec[b].push_back(a);
  }
  dfs(1, 1);
  if (n == cnt && cycles == 2)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
