#include <bits/stdc++.h>
using namespace std;
int ind = 0, n;
int used[101];
int g[101][101];
void dfs(int v) {
  used[v] = 1;
  for (int k = 1; k <= n; k++)
    if (g[v][k] == 1)
      if (used[k] == 0)
        dfs(k);
      else if (used[k] == 2)
        ind++;
  used[v] = 2;
}
int main() {
  int m;
  cin >> n >> m;
  for (int k = 1; k <= m; k++) {
    int a, b;
    cin >> a >> b;
    g[a][b] = g[b][a] = 1;
  }
  dfs(1);
  for (int j = 1; j <= n; j++)
    if (used[j] == 0) {
      cout << "NO";
      return 0;
    }
  if (ind == 1) {
    cout << "FHTAGN!";
    return 0;
  }
  cout << "NO";
  return 0;
}
