#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1e18;
const int INF = 1e9;
const long double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int N = 105;
vector<int> adj[N];
bitset<N> vis;
int cycle;
void dfs(int v) {
  vis[v] = 1;
  for (int& u : adj[v]) {
    if (vis[u] == 0) dfs(u);
  }
}
int main() {
  int n, m;
  scanf("%d %d", &n, &m);
  int a, b;
  for (int i = 0; i < (m); ++i) {
    scanf("%d %d", &a, &b);
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  int comp = 0;
  if (n != m) {
    printf("NO\n");
  } else {
    bool flag = true;
    dfs(1);
    for (int i = 1; i <= n; i++) {
      if (!vis[i]) {
        flag = false;
        break;
      }
    }
    if (flag)
      printf("FHTAGN!\n");
    else
      printf("NO\n");
  }
  return 0;
}
