#include <bits/stdc++.h>
using namespace std;
int n, d[111], fa[111];
bool bo[111][111];
bool vis[111], flag, pd;
int getfa(int x) {
  if (fa[x] == x)
    return x;
  else
    return fa[x] = getfa(fa[x]);
}
void round() {
  int i, j;
  while (1) {
    flag = true;
    for (i = 1; i <= n; i++)
      if (d[i] <= 1 && !vis[i]) {
        flag = false;
        vis[i] = true;
        for (j = 1; j <= n; j++)
          if (bo[i][j]) {
            bo[i][j] = bo[j][i] = false;
            d[i]--;
            d[j]--;
          }
      }
    if (flag) return;
  }
}
int main() {
  int i, j, k, t, m, T, x, y, ans, now, xx, yy;
  while (scanf("%d%d", &n, &m) != EOF) {
    for (i = 1; i <= n; i++) fa[i] = i;
    memset(d, 0, sizeof(d));
    memset(bo, 0, sizeof(bo));
    memset(vis, 0, sizeof(vis));
    for (i = 0; i < m; i++) {
      scanf("%d%d", &x, &y);
      d[x]++;
      d[y]++;
      bo[x][y] = bo[y][x] = true;
      xx = getfa(x);
      yy = getfa(y);
      if (xx != yy) fa[xx] = yy;
    }
    pd = true;
    for (i = 2; i <= n; i++)
      if (getfa(i) != getfa(i - 1)) pd = false;
    round();
    flag = false;
    for (i = 1; i <= n; i++)
      if (!vis[i]) {
        flag = true;
        break;
      }
    if (!flag) pd = false;
    if (flag) {
      for (j = 1; j <= n; j++)
        if (bo[i][j]) {
          bo[i][j] = bo[j][i] = false;
          d[i]--;
          d[j]--;
          break;
        }
      round();
      for (i = 1; i <= n; i++)
        if (!vis[i]) flag = false;
    }
    if (flag && pd)
      puts("FHTAGN!");
    else
      puts("NO");
  }
}
