#include <bits/stdc++.h>
using namespace std;
struct DSU {
  DSU() = default;
  DSU(int n) {
    v.resize(n);
    for (int i = 0; i < (int)n; i++) {
      v[i] = make_pair(i, 1);
    }
  }
  int getLeader(int a) {
    while (v[a].first != a) {
      a = v[a].first;
    }
    return a;
  }
  void merge(int a, int b) {
    int A = getLeader(a);
    int B = getLeader(b);
    if (A == B) return;
    int cntA = v[A].second;
    int cntB = v[B].second;
    if (cntA > cntB) {
      v[B].first = A;
      v[A].second += v[B].second;
    } else {
      v[A].first = B;
      v[B].second += v[A].second;
    }
  }
  bool isConnected() {
    int commonLeader = getLeader(0);
    for (int i = 1; i < (int)v.size(); i++) {
      if (getLeader(i) != commonLeader) return false;
    }
    return true;
  }
  vector<pair<int, int>> v;
};
int main() {
  int n, m;
  cin >> n >> m;
  DSU dsu(n);
  int u, v;
  for (int i = 0; i < (int)m; i++) {
    cin >> u >> v;
    u--;
    v--;
    dsu.merge(u, v);
  }
  string ans = (n == m && dsu.isConnected()) ? "FHTAGN!" : "NO";
  cout << ans << endl;
  return 0;
}
