#include <bits/stdc++.h>
using namespace std;
const unsigned long long MOD = 1e9 + 7;
const int INF = 1e9;
const unsigned long long INF64 = 9e18;
const long double EPS = 1e-9;
const long double PI = 3.14159265358979310000;
const unsigned long long MD = 535355424;
const unsigned long long T = 25342;
const int N = 100001;
const int M = 1001;
int n, m, s = 0;
vector<int> g[M];
int mark[M];
void dfs(int v, int p) {
  mark[v] = 1;
  for (int i = 0; i < int(int((g[v]).size())); i++)
    if (g[v][i] != p) {
      if (mark[g[v][i]] == 1)
        s++;
      else if (!mark[g[v][i]])
        dfs(g[v][i], v);
    }
  mark[v] = 2;
}
int main() {
  cin >> n >> m;
  int first, second;
  for (int i = 0; i < int(m); i++) {
    cin >> first >> second;
    g[first].push_back(second);
    g[second].push_back(first);
  }
  dfs(1, 0);
  for (int i = 1; i <= n; i++)
    if (!mark[i]) s -= INF;
  if (s != 1)
    cout << "NO";
  else
    cout << "FHTAGN!";
  return 0;
}
