#include <bits/stdc++.h>
using namespace std;
vector<int> months = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int MAX = 1e5 + 55;
const int inf = 1e9 + 77;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
const double eps = 1e-7;
int n, m;
vector<int> adj[MAX];
int vis[MAX];
set<int> cycle;
int loop = -1;
bool f = false;
void dfs1(int u, int par = -1) {
  vis[u] = 1;
  for (auto v : adj[u]) {
    if (loop != -1) break;
    if (!vis[v] && v != par)
      dfs1(v, u);
    else if (v != par && loop == -1) {
      loop = v;
      break;
    }
  }
  if (loop != -1 && !f) {
    cycle.insert(u);
    if (u == loop) f = true;
  }
}
int tot = 0;
void dfs2(int u) {
  vis[u] = 1;
  ++tot;
  for (auto v : adj[u]) {
    if (!vis[v]) dfs2(v);
  }
}
int in[MAX], cnt;
bool test;
void check(int u, int par = -1) {
  vis[u] = 1;
  for (auto v : adj[u]) {
    if (v == par) continue;
    if (in[v]) {
      ++cnt;
    } else if (!vis[v]) {
      check(v, u);
    } else if (vis[v] == 1) {
      test = true;
    }
  }
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  for (int i = 0; i < m; ++i) {
    int u, v;
    scanf("%d", &u);
    scanf("%d", &v);
    adj[u].push_back(v);
    adj[v].push_back(u);
  }
  dfs2(1);
  memset(vis, 0, sizeof(vis));
  if (tot != n) {
    printf("NO");
    return 0;
  }
  for (int i = 1; i <= n; ++i) {
    if (!vis[i]) {
      dfs1(i);
      if (!cycle.empty()) break;
    }
  }
  if (cycle.empty()) {
    printf("NO");
    return 0;
  }
  for (auto i : cycle) {
    in[i] = 1;
  }
  for (int i = 1; i <= n; ++i) {
    if (!in[i]) continue;
    memset(vis, 0, sizeof(vis));
    test = false;
    cnt = 0;
    check(i);
    if (test || cnt > 2) {
      break;
    }
  }
  if (test || cnt > 2)
    printf("NO");
  else
    printf("FHTAGN!");
  return 0;
}
