#include <bits/stdc++.h>
using namespace std;
int n, m;
bool use[105];
vector<int> a[105];
void dfs(int f) {
  use[f] = 1;
  for (int i = 0; i < a[f].size(); i++)
    if (!use[a[f][i]]) dfs(a[f][i]);
}
int main() {
  cin >> n >> m;
  int i, j, x, y;
  if (n != m) {
    cout << "NO" << endl;
    return 0;
  }
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    a[x - 1].push_back(y - 1);
    a[y - 1].push_back(x - 1);
  }
  dfs(0);
  for (i = 0; i < n; i++)
    if (!use[i]) {
      cout << "NO" << endl;
      return 0;
    }
  cout << "FHTAGN!" << endl;
  return 0;
}
