#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > arr(120);
bool vis[120] = {false};
void dfs(int node) {
  if (vis[node]) {
    return;
  }
  vis[node] = true;
  for (int i = 0; i < arr[node].size(); i++) {
    dfs(arr[node][i]);
  }
  return;
}
int main() {
  int n, m;
  cin >> n >> m;
  if (n != m) {
    cout << "NO";
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int from, to;
    cin >> from >> to;
    arr[from].push_back(to);
    arr[to].push_back(from);
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "FHTAGN!";
  return 0;
}
