#include <bits/stdc++.h>
using namespace std;
long long int Mod = 1000000007;
void dfs(int v, vector<int> G[], bool visited[]) {
  visited[v] = true;
  for (int i = 0; i < G[v].size(); i++) {
    int u = G[v][i];
    if (!visited[u]) {
      dfs(u, G, visited);
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> G[n + 1];
  for (int i = 0; i < m; i++) {
    int a, b;
    cin >> a >> b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  bool visited[n + 1];
  for (int i = 1; i <= n; i++) {
    visited[i] = false;
  }
  int count = 0;
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      count++;
      dfs(i, G, visited);
    }
  }
  if (count == 1 && (n == m)) {
    cout << "FHTAGN!" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
