#include <bits/stdc++.h>
using namespace std;
const long long int N = 500000;
vector<long long int> g[N];
long long int color[N];
void dfs(long long int k, long long int par, long long int &cyclenumber) {
  if (color[k] == 2)
    return;
  else if (color[k] == 1) {
    cyclenumber++;
    return;
  }
  color[k] = 1;
  for (auto i : g[k]) {
    if (i != par) dfs(i, k, cyclenumber);
  }
  color[k] = 2;
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int i;
  for (i = 0; i < m; i++) {
    long long int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  long long int cyclenumber = 0;
  for (long long int i = 0; i < n; i++) color[i] = 0;
  long long int connected = 0;
  for (i = 1; i <= n; i++)
    if (color[i] == 0) {
      connected++;
      dfs(i, 0, cyclenumber);
    }
  if (cyclenumber == 1 && connected == 1)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
