#include <bits/stdc++.h>
using namespace std;
int countReVisited = 0;
int visited[101];
void dfs(int prev, int n, vector<int> *graph) {
  visited[n] = 1;
  for (int i = 0; i < graph[n].size(); i++) {
    int child = graph[n][i];
    if (visited[child] && child != prev) {
      countReVisited++;
      continue;
    } else if (visited[child])
      continue;
    dfs(n, graph[n][i], graph);
  }
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, m;
  int node1, node2;
  cin >> n >> m;
  vector<int> graph[n + 1];
  for (int i = 0; i < m; i++) {
    cin >> node1 >> node2;
    graph[node1].push_back(node2);
    graph[node2].push_back(node1);
  }
  memset(visited, 0, sizeof(visited));
  dfs(1, 1, graph);
  for (int i = 1; i <= n; i++)
    if (visited[i] == 0) {
      cout << "NO";
      return 0;
    }
  if (countReVisited == 2)
    cout << "FHTAGN!";
  else
    cout << "NO";
}
