#include <bits/stdc++.h>
using namespace std;
const int maxN = 100 + 10;
int n, m;
bool mark[maxN];
int par[maxN];
vector<int> v[maxN];
bool be[maxN][maxN];
int ans = 0;
void dfs(int x) {
  mark[x] = true;
  for (int i = 0; i < v[x].size(); i++) {
    int tmp = v[x][i];
    if (mark[tmp] == false) {
      par[tmp] = x;
      dfs(tmp);
    } else if (mark[tmp] == true && tmp != par[x] && be[x][tmp] == false &&
               be[tmp][x] == false) {
      ans++;
      be[x][tmp] = true;
      be[tmp][x] = true;
    }
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  par[1] = -1;
  int tk = 0;
  for (int i = 1; i <= n; i++)
    if (mark[i] == false) {
      tk++;
      dfs(1);
    }
  if (ans == 1 && tk == 1)
    cout << "FHTAGN!";
  else
    cout << "NO";
  int _;
  cin >> _;
  return 0;
}
