#include <bits/stdc++.h>
using namespace std;
const int N = 10000;
vector<int> graph[N];
vector<int> cycles[N];
void dfs_cycle(int u, int p, int color[], int mark[], int par[],
               int& cyclenumber) {
  if (color[u] == 2) {
    return;
  }
  if (color[u] == 1) {
    cyclenumber++;
    int cur = p;
    mark[cur] = cyclenumber;
    while (cur != u) {
      cur = par[cur];
      mark[cur] = cyclenumber;
    }
    return;
  }
  par[u] = p;
  color[u] = 1;
  for (int v : graph[u]) {
    if (v == par[u]) {
      continue;
    }
    dfs_cycle(v, u, color, mark, par, cyclenumber);
  }
  color[u] = 2;
}
void addEdge(int u, int v) {
  graph[u].push_back(v);
  graph[v].push_back(u);
}
void printCycles(int edges, int mark[], int& cyclenumber) {
  for (int i = 1; i <= edges; i++) {
    if (mark[i] != 0) cycles[mark[i]].push_back(i);
  }
  for (int i = 1; i <= cyclenumber; i++) {
    cout << "Cycle Number " << i << ": ";
    for (int x : cycles[i]) cout << x << " ";
    cout << endl;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    addEdge(a, b);
  }
  int color[N];
  int par[N];
  for (int i = 0; i < N; i++) {
    par[i] = -1;
  }
  int mark[N];
  int cyclenumber = 0;
  int edges = 13;
  dfs_cycle(1, 0, color, mark, par, cyclenumber);
  bool f = true;
  for (int i = 1; i <= n; i++) {
    if (par[i] == -1) {
      f = false;
      ;
    }
  }
  if (cyclenumber == 1 && f) {
    cout << "FHTAGN!" << endl;
  } else {
    cout << "NO" << endl;
  }
}
