#include <bits/stdc++.h>
using namespace std;
int a[102][102], reach[102], n;
void dfs(int v) {
  int i;
  reach[v] = 1;
  for (i = 1; i <= n; i++)
    if (a[v][i] && !reach[i]) {
      dfs(i);
    }
}
int main() {
  int i, j, count = 0;
  int c, b, m;
  scanf("%d%d", &n, &m);
  for (i = 0; i <= n; i++)
    for (j = 0; j <= n; j++) {
      reach[i] = 0;
      a[i][j] = 0;
    }
  for (i = 1; i <= m; i++) {
    cin >> c >> b;
    a[c][b] = 1;
    a[b][c] = 1;
  }
  dfs(1);
  for (i = 1; i <= n; i++)
    if (reach[i]) count++;
  if (count == n && n == m)
    cout << "FHTAGN!";
  else
    cout << "NO";
  return (0);
}
