#include <bits/stdc++.h>
using namespace std;
const int N = 200;
int n, m;
int used[N];
vector<int> g[N];
void travel(int u) {
  used[u] = 1;
  for (auto to : g[u]) {
    if (!used[to]) travel(to);
  }
}
int cycle_st = -1, cycle_ed = -1;
int p[N];
int dfs(int u, int pr = -1) {
  used[u] = 1;
  for (auto to : g[u]) {
    if (used[to] == 0) {
      p[to] = u;
      if (dfs(to, u)) return 1;
    } else if (used[to] == 1 && to != pr) {
      cycle_ed = u;
      cycle_st = to;
      return 1;
    }
  }
  used[u] = 2;
  return 0;
}
bool part[N];
void bfs(int u, int pr = -1) {
  used[u] = 1;
  for (auto to : g[u]) {
    if (to == pr) continue;
    if (used[to] or part[to]) {
      cout << "NO";
      exit(0);
    }
    bfs(to, u);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  travel(1);
  bool bad = 0;
  for (int i = 1; i <= n; i++) bad |= !used[i];
  if (bad) return cout << "NO", 0;
  memset(used, 0, sizeof(used));
  dfs(1);
  if (cycle_st == -1) return cout << "NO", 0;
  vector<int> core = {cycle_st};
  part[cycle_st] = 1;
  while (cycle_ed != cycle_st) {
    core.push_back(cycle_ed);
    part[cycle_ed] = 1;
    cycle_ed = p[cycle_ed];
  }
  memset(used, 0, sizeof(used));
  for (int i = 0; i < core.size(); i++) {
    int u = core[i];
    if (used[u]) return cout << "NO", 0;
    used[u] = 1;
    for (auto to : g[u])
      if (!part[to]) bfs(to, u);
  }
  for (int i = 1; i <= n; i++) bad |= !used[i];
  if (bad) return cout << "NO", 0;
  int num = n - core.size();
  if (m - core.size() != num) return cout << "NO", 0;
  cout << "FHTAGN!";
  return 0;
}
