#include <bits/stdc++.h>
using namespace std;
long long power(long long x, unsigned long long y) {
  long long temp;
  if (y == 0) return 1;
  temp = power(x, y / 2);
  if (y % 2 == 0)
    return temp * temp;
  else
    return x * temp * temp;
}
long long modpow(long long x, unsigned int y, long long p) {
  long long res = 1;
  x = x % p;
  if (y == 0) return 1;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long exponentMod(long long A, long long B, long long C) {
  if (B == 0) return 1;
  if (A == 0) return 0;
  long long y;
  if (B % 2 == 0) {
    y = exponentMod(A, B / 2, C);
    y = (y * y) % C;
  } else {
    y = A % C;
    y = (y * exponentMod(A, B - 1, C) % C) % C;
  }
  return (long long)((y + C) % C);
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int gcdExtended(int a, int b, int *x, int *y) {
  if (a == 0) {
    *x = 0;
    *y = 1;
    return b;
  }
  int x1, y1;
  int gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
void modInverse(int a, int m) {
  int x, y;
  int g = gcdExtended(a, m, &x, &y);
  if (g != 1)
    cout << "Inverse doesn't exist";
  else {
    int res = (x % m + m) % m;
    cout << "Modular multiplicative inverse is " << res;
  }
}
void SieveOfEratosthenes(int n) {
  bool sieve[n + 1];
  long long cnt = 0;
  memset(sieve, 0, sizeof(sieve));
  for (int p = 2; p * p <= n; p++) {
    if (!sieve[p]) {
      for (int i = 2 * p; i <= n; i += p) sieve[i] = p;
    }
  }
  for (int p = 2; p <= n; p++) {
    if (sieve[p]) cnt++;
  }
  cout << cnt;
}
int phi(unsigned int n) {
  float result = n;
  for (int p = 2; p * p <= n; ++p) {
    if (n % p == 0) {
      while (n % p == 0) n /= p;
      result *= (1.0 - (1.0 / (float)p));
    }
  }
  if (n > 1) result *= (1.0 - (1.0 / (float)n));
  return (int)result;
}
long long floorSqrt(long long x) {
  if (x == 0 || x == 1) return x;
  unsigned long long start = 1, end = x, ans;
  while (start <= end) {
    unsigned long long mid = start + (end - start) / 2;
    if (mid * mid == x) return mid;
    if (mid * mid < x) {
      start = mid + 1;
      ans = mid;
    } else
      end = mid - 1;
  }
  return ans;
}
void start() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  start();
  long long n, m;
  cin >> n >> m;
  vector<long long> adj[n + 1];
  for (long long i = 0; i < m; i++) {
    long long a, b;
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  queue<long long> q;
  bool vis[n + 1];
  memset(vis, false, sizeof(vis));
  long long cnt = 0;
  for (long long i = 1; i < n + 1; i++) {
    if (!vis[i]) {
      q.push(i);
      cnt++;
      vis[i] = true;
      while (!q.empty()) {
        long long curr = q.front();
        q.pop();
        for (auto x : adj[curr]) {
          if (!vis[x]) {
            vis[x] = true;
            q.push(x);
          }
        }
      }
    }
  }
  if (cnt == 1 && n == m) {
    cout << "FHTAGN!";
  } else
    cout << "NO";
}
