#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int n, m;
int fa[N];
bool ans, ansf = true;
int find(int x) {
  if (fa[x] != x) fa[x] = find(fa[x]);
  return fa[x];
}
void unionn(int x, int y) { fa[y] = x; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; ++i) fa[i] = i;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    if (x > y) swap(x, y);
    int fx = find(x);
    int fy = find(y);
    if (fx == fy)
      ans = true;
    else
      unionn(fx, fy);
  }
  int x = find(1);
  for (int i = 2; i <= n; ++i)
    if (find(i) != x) {
      ansf = false;
      break;
    }
  if (ans && ansf && n == m)
    cout << "FHTAGN!";
  else
    cout << "NO";
  return 0;
}
