#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
long long INF = 1000 * 1000 * 1000;
vector<int> p;
vector<int> r;
void make_set(int v) {
  p[v] = v;
  r[v] = 0;
}
int find_set(int v) {
  if (v == p[v]) return v;
  return p[v] = find_set(p[v]);
}
void union_set(int a, int b) {
  a = find_set(a);
  b = find_set(b);
  if (r[a] < r[b]) swap(a, b);
  p[b] = a;
  if (r[a] == r[b]) r[a]++;
}
int main() {
  int n, m;
  cin >> n >> m;
  p.resize(n + 1);
  r.resize(n + 1);
  for (int i = 1; i <= n; ++i) make_set(i);
  int c = 0;
  for (int i = 0; i < m; ++i) {
    int a, b;
    cin >> a >> b;
    a = find_set(a);
    b = find_set(b);
    if (a == b) c++;
    union_set(a, b);
  }
  int a = find_set(1);
  for (int i = 2; i <= n; ++i)
    if (a != find_set(i)) {
      cout << "NO";
      return 0;
    }
  if (c == 1)
    cout << "FHTAGN!";
  else
    cout << "NO";
  return 0;
}
