#include <bits/stdc++.h>
using namespace std;
vector<int> v[105];
int visit[105];
int c;
void dfs(int i) {
  visit[i] = 1;
  vector<int>::iterator it;
  for (it = v[i].begin(); it != v[i].end(); it++) {
    if (visit[(*it)] == 0) {
      c++;
      dfs((*it));
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, m, a, b, i;
  cin >> n >> m;
  for (i = 1; i <= m; i++) {
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  c++;
  dfs(1);
  if (c == n && m == n)
    cout << "FHTAGN!";
  else
    cout << "NO";
  return 0;
}
