#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const long long int N = 1e5 + 5;
long long int mod = 998244353;
void dfs(long long int node, long long int rank, vector<long long int> &vis,
         vector<vector<long long int>> &g, long long int &cnt) {
  vis[node] = rank;
  for (auto &nbr : g[node]) {
    if (vis[nbr] == -1) {
      dfs(nbr, rank + 1, vis, g, cnt);
    } else if (rank - vis[nbr] >= 2) {
      cnt++;
    }
  }
}
void null() {
  long long int n, m;
  cin >> n >> m;
  vector<vector<long long int>> g(n + 1);
  for (long long int i = 0; i < m; i++) {
    long long int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
  }
  vector<long long int> vis(n + 1, -1);
  long long int cnt = 0;
  dfs(1, 1, vis, g, cnt);
  for (long long int i = 1; i < n + 1; i++) {
    if (vis[i] == -1) {
      cout << "NO\n";
      return;
    }
  }
  if (cnt == 1)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  cout << setprecision(4);
  cout << fixed;
  long long int t = 1;
  clock_t start, end;
  start = clock();
  while (t--) {
    null();
  }
  end = clock();
  double time_taken = double(end - start) / double(CLOCKS_PER_SEC);
}
