#include <bits/stdc++.h>
using namespace std;
const int Max = 110;
vector<int> adj[Max];
void init(int n) {
  int i;
  for (i = 1; i <= n; i++) adj[i].clear();
}
int vis[Max];
int ans;
int s;
void dfs(int i, int lev) {
  vis[i] = 1;
  int j, len = adj[i].size();
  for (j = 0; j < len; j++) {
    int v = adj[i][j];
    if (v == s) {
      if (ans < lev) ans = lev;
    }
    if (vis[v] == 0) {
      dfs(v, lev + 1);
    }
  }
}
int solve(int n) {
  int i;
  ans = 0;
  s = 1;
  memset(vis, 0, sizeof(vis));
  dfs(1, 1);
  for (i = 1; i <= n; i++) {
    if (vis[i] == 0) return 0;
  }
  if (ans >= 3) return 1;
  for (i = 2; i <= n; i++) {
    memset(vis, 0, sizeof(vis));
    s = i;
    dfs(i, 1);
    if (ans >= 3) return 1;
  }
  return 0;
}
int main() {
  int n, m;
  int go;
  while (scanf("%d %d", &n, &m) != EOF) {
    init(n);
    int a, b;
    int tm = m;
    while (tm--) {
      scanf("%d %d", &a, &b);
      adj[a].push_back(b);
      adj[b].push_back(a);
    }
    if (m != n) {
      printf("NO\n");
      continue;
    }
    go = solve(n);
    if (go)
      printf("FHTAGN!\n");
    else
      printf("NO\n");
  }
  return 0;
}
