#include <bits/stdc++.h>
using namespace std;
template <class U, class V>
ostream& operator<<(ostream& os, const pair<U, V>& p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class U, class V>
istream& operator>>(istream& in, pair<U, V>& p) {
  in >> p.first >> p.second;
  return in;
}
long long n, f, s;
vector<vector<long long>> al;
void dfsvis(long long u, bool* mark) {
  mark[u] = 1;
  for (long long v : al[u]) {
    if (!mark[v]) {
      dfsvis(v, mark);
    }
  }
}
bool iscon() {
  bool mark[n];
  memset(mark, 0, sizeof(mark));
  ;
  dfsvis(0, mark);
  for (long long i = 0; i < n; i++) {
    if (!mark[i]) {
      return 0;
    }
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(false);
  long long m;
  cin >> n >> m;
  al = vector<vector<long long>>(n);
  for (long long i = 0; i < m; i++) {
    long long u, v;
    cin >> u >> v;
    al[u - 1].push_back(v - 1), al[v - 1].push_back(u - 1);
  }
  if (!iscon()) {
    cout << "NO";
    return 0;
  }
  if (m - (n - 1) == 1) {
    cout << "FHTAGN!";
  } else {
    cout << "NO";
  }
  return 0;
}
