#include <bits/stdc++.h>
using namespace std;
int nro_ciclos = 0;
void DFS(vector<pair<int, vector<int>>> &graph, int a, int b) {
  if (graph[a].first == 0) {
    graph[a].first = 1;
    for (int i = 0; i < graph[a].second.size(); ++i) {
      if (graph[graph[a].second[i]].first == 1 && graph[a].second[i] != b)
        ++nro_ciclos;
      DFS(graph, graph[a].second[i], a);
    }
    graph[a].first = 2;
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<pair<int, vector<int>>> graph(n);
  int a, b;
  for (int i = 0; i < m; ++i) {
    cin >> a >> b;
    graph[a - 1].first = 0;
    graph[a - 1].second.push_back(b - 1);
    graph[b - 1].first = 0;
    graph[b - 1].second.push_back(a - 1);
  }
  DFS(graph, 0, -1);
  bool tmp = 1;
  for (int i = 0; i < n; ++i)
    if (graph[i].first != 2) {
      tmp = 0;
      break;
    }
  if (nro_ciclos == 1 && tmp)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
