#include <bits/stdc++.h>
using namespace std;
vector<int> adj[105];
vector<pair<int, int>> edge;
bool mark[105];
void dfs(int x, int dx, int dy) {
  mark[x] = true;
  for (int i = 0; i < adj[x].size(); i++) {
    int y = adj[x][i];
    if (mark[y]) continue;
    if (x == dx && y == dy) continue;
    if (x == dy && y == dx) continue;
    dfs(y, dx, dy);
  }
}
int main() {
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x, y;
    cin >> x >> y;
    edge.push_back(make_pair(x, y));
    adj[x].push_back(y);
    adj[y].push_back(x);
  }
  if (n != m || n < 3) {
    cout << "NO";
    return 0;
  }
  for (int i = 0; i < m; i++) {
    int x = edge[i].first;
    int y = edge[i].second;
    memset(mark, 0, sizeof(mark));
    dfs(x, x, y);
    bool flag = true;
    for (int i = 1; i <= n; i++) flag &= mark[i];
    if (flag) {
      cout << "FHTAGN!" << endl;
      return 0;
    }
  }
  cout << "NO";
}
