#include <bits/stdc++.h>
using namespace std;
int vis[1000] = {0};
vector<int> v[1000];
void paltu(int x) {
  if (vis[x] == 1) {
    return;
  }
  vis[x] = 1;
  for (int i = 0; i < v[x].size(); i++) {
    paltu(v[x][i]);
  }
}
int main() {
  int n, m, i, a, b;
  cin >> n >> m;
  for (i = 0; i < m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  if (n != m) {
    cout << "NO";
    return 0;
  }
  paltu(1);
  for (i = 1; i <= n; i++) {
    if (vis[i] == 0) {
      cout << "NO";
      return 0;
    }
  }
  cout << "FHTAGN!";
  return 0;
}
