#include <bits/stdc++.h>
using namespace std;
vector<int> g[100010];
int visited[100010];
int parent[100010];
int flag;
void explore(int u) {
  visited[u] = 1;
  for (int i = 0; i < g[u].size(); i++) {
    if (!visited[g[u][i]]) {
      parent[g[u][i]] = u;
      explore(g[u][i]);
    } else if (g[u][i] == parent[u])
      ;
    else
      flag++;
  }
}
int n;
int dfs() {
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (visited[i])
      continue;
    else {
      explore(i);
      cnt++;
      if (cnt > 1) return 0;
    }
  }
  if (flag == 2) return 1;
}
int main() {
  int m;
  int e = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
    e++;
  }
  if (m != n) {
    cout << "NO" << endl;
    return 0;
  }
  int k = dfs();
  if (k)
    cout << "FHTAGN!" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
