#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<vector<long long> > adj_list;
vector<bool> visited;
long long cnt = 0;
void dfs(long long node) {
  visited[node] = true;
  ++cnt;
  for (auto neigh : adj_list[node]) {
    if (!visited[neigh]) {
      dfs(neigh);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long n, m;
  cin >> n >> m;
  if (n != m) {
    cout << "NO";
    return 0;
  }
  adj_list.resize(n + 1);
  for (long long i = 0; i < m; ++i) {
    long long a, b;
    cin >> a >> b;
    adj_list[a].push_back(b);
    adj_list[b].push_back(a);
  }
  visited.resize(n + 1);
  dfs(1);
  if (cnt == n) {
    cout << "FHTAGN!";
  } else {
    cout << "NO";
  }
  return 0;
}
