#include <bits/stdc++.h>
using namespace std;
const char letters[] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i',
                        'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r',
                        's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
const int dx[] = {0, -1, 0, 1, -1, -1, 1, 1};
const int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
long long inline max3(long long a, long long b, long long c) {
  return max(a, max(b, c));
}
long long inline min3(long long a, long long b, long long c) {
  return min(a, min(b, c));
}
long long power(long long x, long long p) {
  if (p == 0)
    return 1;
  else if (p % 2 == 0)
    return power(1LL * x * x, p / 2);
  else
    return 1LL * x * power(1LL * x * x, (p - 1) / 2);
}
long long GCD(long long a, long long b) {
  if (b == 0) return a;
  return GCD(b, a % b);
}
const int N = 150;
int n, m;
vector<vector<int> > G(N);
bool vis[N];
void dfs(int u, int p) {
  vis[u] = 1;
  for (int i = 0; i < ((int)G[u].size()); ++i) {
    if (!vis[G[u][i]]) dfs(G[u][i], u);
  }
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0, u, v; i < m; ++i) {
    scanf("%d", &u);
    scanf("%d", &v);
    G[u].push_back(v), G[v].push_back(u);
  }
  int cnt = 0;
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      ++cnt;
      if (cnt > 1 || n != m)
        return puts("NO");
      else
        dfs(i, i);
    }
  }
  puts("FHTAGN!");
  return 0;
}
