#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e8;
const double pi = 3.1415926535897;
const double EPS = (1e-7);
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }
struct edge {
  int from, to, w;
  edge(int u, int v, int w) : from(u), to(v), w(w) {}
  bool operator<(const edge &e) const { return w > e.w; }
};
const int N = 105;
int par[N];
int get(int u) { return par[u] == u ? u : get(par[u]); }
void unite(int u, int v) {
  int par1 = get(u);
  int par2 = get(v);
  if (par1 != par2) {
    par[par2] = par1;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < n; i++) par[i] = i;
  int x, y;
  for (int i = 0; i < m; i++) {
    cin >> x >> y;
    x--;
    y--;
    unite(x, y);
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (par[i] == i) ans++;
  }
  if (ans == 1 && n == m) {
    cout << "FHTAGN!";
  } else
    cout << "NO";
}
