#include <bits/stdc++.h>
using namespace std;
int const N = 3112;
int const INF = 1e9 + 7;
int n, m;
vector<int> g[N];
int used[N];
int cnt;
void dfs(int v) {
  used[v] = true;
  for (int c = 0; c < g[v].size(); c++) {
    if (!used[g[v][c]]) dfs(g[v][c]);
  }
}
int main() {
  int x, y;
  cin >> n >> m;
  if (n != m) {
    cout << "NO";
    return 0;
  }
  for (int c = 1; c <= m; c++) {
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  dfs(1);
  for (int c = 1; c <= n; c++) {
    if (!used[c]) {
      cout << "NO";
      return 0;
    }
  }
  cout << "FHTAGN!";
  return 0;
}
