#include <bits/stdc++.h>
long long gcd(long long a, long long b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (((a * b) / gcd(a, b))); }
long long phi(long long n) {
  long long result = n;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) n /= i;
      result -= result / i;
    }
  }
  if (n > 1) result -= result / n;
  return result;
}
long long binpow(long long a, long long n, long long c) {
  long long res = 1;
  while (n) {
    if (n & 1) res *= a;
    res %= c;
    a *= a;
    a %= c;
    n >>= 1;
  }
  res = (res + c) % c;
  return res;
}
void nxi(long long& n) {
  bool min = 0;
  char c;
  n = 0;
  while ((c = getc(stdin)) && c <= 32)
    ;
  if (c == '-')
    min = 1;
  else
    n = c - 48;
  while ((c = getc(stdin)) && c > 32) n = (n << 3) + (n << 1) + c - 48;
  if (min) n = -n;
}
void prl(long long n) {
  if (n == 0) {
    puts("0");
    return;
  }
  if (n < 0) {
    putchar('-');
    n = -n;
  }
  static long long s[10];
  long long top = 0;
  while (n > 0) s[top++] = n % 10, n /= 10;
  while (top--) putchar(s[top] + 48);
  puts("");
}
using namespace std;
const int nmax = 1100;
long long n, a[nmax][nmax], m;
vector<int> g[nmax];
int cycle = -1, par[nmax], color[nmax];
bool ban[nmax];
int cnt = 0;
void outv(vector<int> v) {
  for (int i = 0; i < v.size(); i++) cout << v[i] << " ";
  cout << endl;
}
void out() {
  puts("NO");
  exit(0);
}
void dfs(int v, int p = -1) {
  par[v] = p;
  color[v] = 1;
  for (int i = 0; i < g[v].size(); i++) {
    int to = g[v][i];
    if (color[to] == 1 && to != p)
      cycle = v, cnt++;
    else if (color[to] == 0)
      dfs(to, v);
  }
  color[v] = 2;
}
bool check(vector<int> cc) {
  cc.erase(cc.begin());
  cc.erase(cc.begin() + cc.size() - 1);
  for (int i = 0; i < cc.size(); i++)
    for (int j = i + 2; j < cc.size(); j++) {
      int v = cc[i], to = cc[j];
      if (a[v][to]) return false;
    }
  return 1;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    g[x].push_back(y);
    g[y].push_back(x);
    a[x][y] = a[y][x] = 1;
  }
  dfs(1);
  for (int i = 1; i <= n; i++) {
    if (color[i] == 0) out();
  }
  if (cycle == -1 || cnt > 1) out();
  vector<int> cc;
  while (cycle > 0) {
    cc.push_back(cycle);
    ban[cycle] = 1;
    cycle = par[cycle];
  }
  int cntV = cc.size(), edges = cntV;
  if (n - cntV + 1 == m - edges + 1 && n - cntV >= 3)
    puts("FHTAGN!");
  else if (check(cc))
    puts("FHTAGN!");
  else
    out();
  return 0;
}
