#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000;
vector<int> g[MAX_N + 10];
vector<int> dfs_trace;
bool is_circle[MAX_N + 10] = {0};
int circles_finded = 0;
int b[MAX_N + 10] = {0};
void scanGraph(int m) {
  int x;
  int y;
  for (int i = 0; i < m; ++i) {
    scanf("%d %d", &x, &y);
    g[x].push_back(y);
    g[y].push_back(x);
  }
}
void dfs(int v, int prev) {
  b[v] = 1;
  dfs_trace.push_back(v);
  for (int e = 0; e < g[v].size(); ++e) {
    if (b[g[v][e]] == 1 && prev != g[v][e]) {
      circles_finded++;
      for (int i = dfs_trace.size() - 1; dfs_trace[i] != g[v][e];
           is_circle[dfs_trace[i]] = true, --i)
        ;
      is_circle[g[v][e]] = true;
    }
    if (b[g[v][e]] == 0) {
      dfs(g[v][e], v);
    }
  }
  while (dfs_trace[dfs_trace.size() - 1] != v) {
    dfs_trace.pop_back();
  }
  dfs_trace.pop_back();
  b[v] = 2;
}
bool find1Cilrclre(int n) {
  dfs(1, 0);
  for (int i = 1; i <= n; ++i) {
    if (b[i] != 2) return false;
  }
  return (circles_finded == 1);
}
int countTreesOnCircle(int n) {
  int count = 0;
  for (int i = 1; i <= n; ++i) {
    if (is_circle[i]) {
      count++;
    }
  }
  return count;
}
int main() {
  int n;
  int m;
  scanf("%d %d", &n, &m);
  scanGraph(m);
  if (!find1Cilrclre(n)) {
    printf("NO");
    return 0;
  }
  if (countTreesOnCircle(n) < 3) {
    printf("NO");
    return 0;
  }
  printf("FHTAGN!");
  return 0;
}
