#include <bits/stdc++.h>
using namespace std;
void dfs(vector<int>* graph, int sv, bool* visited, int& count, int parent) {
  visited[sv] = true;
  for (int i = 0; i < graph[sv].size(); i++) {
    int p = graph[sv][i];
    if (!visited[p]) {
      dfs(graph, p, visited, count, sv);
    } else if (p != parent) {
      count++;
    }
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  vector<int>* graph = new vector<int>[n + 1];
  for (int i = 0; i < m; i++) {
    int s, d;
    cin >> s >> d;
    graph[s].push_back(d);
    graph[d].push_back(s);
  }
  bool* visited = new bool[n + 1]{0};
  int count = 0;
  dfs(graph, 1, visited, count, -1);
  for (int i = 1; i <= n; i++) {
    if (!visited[i]) {
      cout << "NO" << endl;
      return 0;
    }
  }
  count /= 2;
  if (count == 1) {
    cout << "FHTAGN!" << endl;
  } else {
    cout << "NO" << endl;
  }
}
