#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
void FastInputOutput() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
void ReadFromFile(string name, string extention) {
  string fullPath = name + "." + extention;
  freopen(fullPath.c_str(), "r", stdin);
}
inline int D() {
  int t;
  scanf("%d", &t);
  return t;
}
inline long long LLD() {
  long long t;
  scanf("%lld", &t);
  return t;
}
inline char C() {
  char c;
  scanf("%c", &c);
  return c;
}
inline long long power(long long x, long long p, long long m) {
  long long res = 1;
  while (p) {
    if (p & 1) res = (res * x) % m;
    x = (x * x) % m;
    p >>= 1;
  }
  return res;
}
long double ModLog(long double base, long double x) {
  return (logl(x) / logl(base));
}
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
const int N = 1e4 + 5;
vector<int> adj[N];
int vst[N];
void DFS(int u) {
  vst[u] = 1;
  for (auto v : adj[u])
    if (!vst[v]) DFS(v);
}
int main() {
  int n = D(), m = D();
  for (int i = 0; i < m; ++i) {
    int u = D(), v = D();
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  DFS(1);
  bool ans = n == m;
  for (int i = 1; i <= n && ans; ++i) ans &= vst[i];
  puts(ans ? "FHTAGN!" : "NO");
  return 0;
}
