#include <bits/stdc++.h>
using namespace std;
bool vis[101];
vector<int> a[101];
void dfs(int x) {
  vis[x] = true;
  for (int i = 0; i < a[x].size(); i++)
    if (!vis[a[x][i]]) dfs(a[x][i]);
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    a[x].push_back(y);
    a[y].push_back(x);
  }
  dfs(1);
  if (*min_element(vis + 1, vis + n + 1) && m == n)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
