#include <bits/stdc++.h>
using namespace std;
int par[101];
int find_rep(int a);
void Union(int a, int b);
int main() {
  int node_num, edge_num;
  while (scanf("%d %d", &node_num, &edge_num) == 2) {
    for (int i = int(1); i <= int(100); i++) par[i] = i;
    int n1, n2, cycle_num = 0;
    for (int i = int(1); i <= int(edge_num); i++) {
      scanf("%d %d", &n1, &n2);
      int u = find_rep(n1);
      int v = find_rep(n2);
      if (u != v)
        Union(u, v);
      else
        cycle_num++;
    }
    if (cycle_num != 1) {
      printf("NO\n");
      continue;
    } else {
      int rep = find_rep(1);
      bool found = true;
      for (int i = int(2); i <= int(node_num); i++) {
        int rep2 = find_rep(i);
        if (rep != rep2) {
          found = false;
          break;
        }
      }
      if (found)
        printf("FHTAGN!\n");
      else
        printf("NO\n");
    }
  }
  return 0;
}
int find_rep(int a) {
  if (par[a] == a)
    return a;
  else
    return par[a] = find_rep(par[a]);
}
void Union(int a, int b) {
  int u = find_rep(a);
  int v = find_rep(b);
  if (u != v) par[v] = u;
}
