#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
template <typename T>
using pqg = priority_queue<T, vector<T>, greater<T>>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
bool ckmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
bool ckmax(T& a, const T& b) {
  return a < b ? a = b, 1 : 0;
}
string to_string(char c) { return string(1, c); }
string to_string(const char* s) { return (string)s; }
string to_string(const string& s) { return '"' + s + '"'; }
string to_string(bool b) { return (b ? "true" : "false"); }
string to_string(vector<bool> v) {
  string res = "{";
  for (int i = (0); i < (int((v).size())); ++i) res += char('0' + v[i]);
  res += "}";
  return res;
}
template <size_t SZ>
string to_string(bitset<SZ> b) {
  string res;
  for (int i = (0); i < (SZ); ++i) res += char('0' + b[i]);
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A>
string to_string(A v) {
  bool first = 1;
  string res = "{";
  for (const auto& x : v) {
    if (!first) res += ", ";
    first = 0;
    res += to_string(x);
  }
  res += "}";
  return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void dbgOut() { cerr << "]" << '\n'; }
template <typename H, typename... T>
void dbgOut(H h, T... t) {
  cerr << to_string(h);
  if (sizeof...(t)) cerr << ", ";
  dbgOut(t...);
}
int n, m;
vi G[105];
int vis[105];
int cycles;
void dfs(int i) {
  vis[i] = 1;
  for (auto& x : G[i]) {
    if (!vis[x]) dfs(x);
  }
}
void solve() {
  cin >> n >> m;
  for (int i = (0); i < (m); ++i) {
    int u, v;
    cin >> u >> v;
    --u;
    --v;
    G[u].push_back(v);
    G[v].push_back(u);
  }
  if (n != m) {
    cout << "NO";
    return;
  }
  dfs(0);
  for (int i = (0); i < (n); ++i) {
    if (!vis[i]) {
      cout << "NO";
      return;
    }
  }
  cout << "FHTAGN!";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  solve();
}
