#include <bits/stdc++.h>
using namespace std;
const int INFint = 2e9;
const long long INF = 1e18;
const long long MOD = 1000000007ll;
int g[100][100];
vector<int> used;
set<int> roots;
int n, m;
void dfs(int v, int p) {
  used[v] = 1;
  for (int i = 0; i < n; i++) {
    if (i == p || !g[v][i]) continue;
    if (used[i] || roots.count(i)) {
      cout << "NO";
      exit(0);
    }
    dfs(i, v);
  }
  used[v] = 1;
}
vector<int> anc;
void addCycle(int st, int en) {
  int v = en;
  while (v != st) {
    roots.insert(v);
    v = anc[v];
  }
  roots.insert(st);
}
bool cycle(int v, int p = -1) {
  used[v] = 1;
  for (int i = 0; i < n; i++) {
    if (i == p || !g[v][i]) continue;
    if (used[i]) {
      addCycle(i, v);
      return 1;
    }
    anc[i] = v;
    if (cycle(i, v)) return 1;
  }
  used[v] = 1;
  return 0;
}
vector<int> p;
int get(int v) { return p[v] == v ? v : p[v] = get(p[v]); }
void unite(int a, int b) {
  a = get(a);
  b = get(b);
  if (a == b) return;
  if (rand() & 1) swap(a, b);
  p[a] = b;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  used.resize(n);
  p.resize(n);
  for (int i = 0; i < n; i++) p[i] = i;
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    a--, b--;
    unite(a, b);
    g[a][b] = g[b][a] = 1;
  }
  int cnt = 0;
  for (int i = 0; i < n; i++)
    if (p[i] == i) cnt++;
  if (cnt != 1) {
    cout << "NO";
    return 0;
  }
  anc.resize(n);
  for (int i = 0; i < n; i++) {
    if (!used[i]) {
      if (cycle(i)) break;
    }
  }
  if (roots.size() < 3) {
    cout << "NO";
    return 0;
  }
  used.assign(n, 0);
  for (auto v : roots) {
    for (int i = 0; i < n; i++) {
      if (g[v][i] && !roots.count(i)) {
        dfs(i, v);
      }
    }
  }
  cout << "FHTAGN!";
  fprintf(stderr, "\nTIME = %lf\n", 1.0 * clock() / CLOCKS_PER_SEC);
  ;
  return 0;
}
