#include <bits/stdc++.h>
using namespace std;
template <typename T>
T pow(T a, T b, long long int m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = (ans * a) % m;
    b /= 2;
    a = (a * a) % m;
  }
  return ans % m;
}
template <typename T>
void swap(T *a, T *b) {
  T temp = *a;
  *a = *b;
  *b = temp;
  return;
}
struct custom_hash {
  static uint64_t splitmix64(uint64_t x) {
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM =
        chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};
unordered_map<long long, long long int, custom_hash> safe_map;
const long long int N = 1e2 + 2;
std::vector<long long int> v[N];
std::vector<bool> visit(N, 0);
void dfs(long long int node) {
  if (visit[node]) return;
  visit[node] = true;
  for (auto i : v[node]) {
    dfs(i);
  }
  return;
}
signed main() {
  long long int n, m;
  cin >> n >> m;
  long long int NoOfCycles = 0;
  for (__typeof(m) i = (0) - ((0) > (m)); i != (m) - ((0) > (m));
       i += 1 - 2 * ((0) > (m))) {
    long long int x, y;
    cin >> x >> y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  for (__typeof(n + 1) i = (1) - ((1) > (n + 1));
       i != (n + 1) - ((1) > (n + 1)); i += 1 - 2 * ((1) > (n + 1))) {
    if (!visit[i]) {
      dfs(i);
      NoOfCycles++;
    }
  }
  if (NoOfCycles == 1 and n == m) {
    cout << "FHTAGN!";
  } else {
    cout << "NO";
  }
}
