#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e2 + 10, mod = 1e9 + 7;
int n, m, cycle = 0, par[maxn];
bool mark[maxn];
vector<int> adj[maxn];
pair<int, int> d;
void dfs(int v) {
  mark[v] = 1;
  for (auto u : adj[v])
    if (!mark[u]) {
      par[u] = v;
      dfs(u);
    } else if (u != par[v] && (d.first != min(u, v) && d.second != max(u, v))) {
      cycle++;
      if (cycle >= 2) {
        cout << "NO\n";
        exit(0);
      } else {
        d.first = min(u, v);
        d.second = max(u, v);
      }
    }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  d.first = -1;
  d.second = -1;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int u, v;
    cin >> u >> v;
    adj[--v].push_back(--u);
    adj[u].push_back(v);
  }
  par[0] = -1;
  dfs(0);
  for (int i = 0; i < n; i++)
    if (!mark[i]) {
      cout << "NO\n";
      return 0;
    }
  if (cycle == 1)
    cout << "FHTAGN!\n";
  else
    cout << "NO\n";
  return 0;
}
