#include <bits/stdc++.h>
using namespace std;
int n, m, a[100][100], vis[100], p[100];
void dfs(int x) {
  vis[x] = 1;
  for (int i = 0; i < n; i++)
    if (a[x][i]) {
      if (vis[i]) {
        if (p[x] != i) m++;
      } else {
        p[i] = x;
        dfs(i);
      }
    }
}
int main() {
  int x, y;
  cin >> n >> m;
  memset(p, -1, sizeof(p));
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    a[x][y] = a[y][x] = 1;
  }
  m = 0;
  dfs(0);
  y = 0;
  for (int i = 0; i < n; i++)
    if (!vis[i]) {
      y = 1;
      break;
    }
  if (m != 2 || y)
    printf("NO");
  else
    printf("FHTAGN!");
}
