#include <bits/stdc++.h>
using namespace std;
const double pi = 2 * acos(0.0);
const int inf = 0x3f3f3f3f;
const double infd = 1.0 / 0.0;
long long power(long long x, long long y, long long MOD) {
  long long res = 1;
  x = x % MOD;
  while (y > 0) {
    if (y & 1) res = (res * x) % MOD;
    y = y >> 1;
    x = (x * x) % MOD;
  }
  return res;
}
long long mul(long long a, long long b, long long MOD) {
  if (b == 1) {
    return a;
  }
  if (b % 2 == 0) {
    return 2 * (mul(a, b / 2, MOD) % MOD);
  } else {
    return (a + (2 * (mul(a, b / 2, MOD)) % MOD)) % MOD;
  }
}
bool ispow2(long long n) {
  if (((n & (n - 1)) == 0) && n != 0) {
    return true;
  }
  return false;
}
bool prime(int x) {
  if (x == 1) {
    return false;
  }
  if (x == 2) {
    return true;
  }
  if (x % 2 == 0) {
    return false;
  }
  for (int i = 3; i * i <= x; i += 2) {
    if (x % i == 0) {
      return false;
    }
  }
  return true;
}
int __gcd(int a, int b) {
  if (b == 0) return a;
  return __gcd(b, a % b);
}
int coprime(int a, int b) {
  if (a == b) return 0;
  if (prime(a) && prime(b)) return 1;
  if ((a == 2 && b % 2 != 0) || (b == 2 && a % 2 != 0)) return 1;
  if ((a % 2 != 0 && prime(b) && a < b) || (b % 2 != 0 && prime(a) && a > b))
    return 1;
  if (abs(a - b) == 1) return 1;
  if (a == 1 || b == 1) return 1;
  return __gcd(a, b);
}
unsigned long long lcm(unsigned a, unsigned b) {
  return ((unsigned long long)a) * (b / __gcd(a, b));
}
int n, m, x, y;
vector<int> g[101];
int vis[101];
int cnt = 0;
void dfs(int u) {
  vis[u] = 1;
  cnt++;
  for (int i = 0; i < g[u].size(); i++) {
    if (!vis[g[u][i]]) {
      dfs(g[u][i]);
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  memset(vis, 0, sizeof(vis));
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  if (n == m) {
    dfs(1);
    (cnt == n) ? cout << "FHTAGN!" << endl : cout << "NO" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
