#include <bits/stdc++.h>
using namespace std;
int maxi = 102;
vector<vector<int>> mat(maxi, vector<int>(maxi, 0));
vector<int> vis(maxi, 0);
int visitados = 0;
void dfs(int v, int n) {
  vis[v] = 1;
  visitados++;
  for (int i = 1; i < n + 1; i++) {
    if (vis[i]) {
      continue;
    } else {
      if (mat[v][i]) {
        dfs(i, n);
      }
    }
  }
}
int main() {
  int n, m;
  int a, b;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    mat[a][b] = 1;
    mat[b][a] = 1;
  }
  dfs(1, n);
  if (n == m) {
    if (n == visitados) {
      cout << "FHTAGN!";
    } else {
      cout << "NO";
    }
  } else {
    cout << "NO";
  }
}
