#include <bits/stdc++.h>
using namespace std;
const int N = 150;
int a, b, c, n, m;
int root[N];
void make_set(int vertex) { root[vertex] = vertex; }
int find_set(int vertex) {
  if (root[vertex] != vertex) root[vertex] = find_set(root[vertex]);
  return root[vertex];
}
void union_set(int vertex1, int vertex2) {
  int leader1 = find_set(vertex1);
  int leader2 = find_set(vertex2);
  root[leader1] = leader2;
}
int main() {
  scanf("%d%d\n", &n, &m);
  if (m != n) {
    puts("NO");
    return 0;
  }
  for (a = 0; a < n; a++) make_set(a);
  for (a = 0; a < m; a++) {
    int vertex1, vertex2;
    scanf("%d%d\n", &vertex1, &vertex2);
    union_set(vertex1 - 1, vertex2 - 1);
  }
  for (a = 0; a < n - 1; a++)
    if (find_set(a) != find_set(a + 1)) {
      puts("NO");
      return 0;
    }
  puts("FHTAGN!");
  return 0;
}
