#include <bits/stdc++.h>
using namespace std;
int find_set(int v, vector<int> &p) {
  if (v == p[v]) return v;
  return p[v] = find_set(p[v], p);
}
void union_set(int a, int b, vector<int> &p) {
  a = find_set(a, p);
  b = find_set(b, p);
  if (a != b) {
    p[b] = a;
  }
}
long long int ans = 0;
void dfs(int i, vector<int> &vis, vector<int> adj[]) {
  vis[i] = 1;
  for (int k = 0; k < adj[i].size(); k++) {
    if (vis[adj[i][k]] == 0) {
      dfs(adj[i][k], vis, adj);
    }
  }
}
void solve() {
  int n, m;
  cin >> n >> m;
  vector<int> adj[n];
  int a, b;
  for (int i = 0; i < m; i++) {
    cin >> a >> b;
    a--;
    b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  vector<int> vis(n, 0);
  dfs(0, vis, adj);
  if (find(vis.begin(), vis.end(), 0) != vis.end()) {
    cout << "NO" << endl;
    return;
  }
  if (m - n + 1 == 1) {
    cout << "FHTAGN!" << endl;
    return;
  }
  cout << "NO" << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int T;
  T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
