#include <bits/stdc++.h>
using namespace std;
vector<long long int> graph[101];
vector<long long int> visit;
long long int n, m;
void dfs(long long int x) {
  visit[x] = 1;
  long long int j = graph[x].size();
  for (long long int i = 0; i < j; i++) {
    long long int y = graph[x][i];
    if (!visit[y]) dfs(y);
  }
}
int main() {
  cin >> n;
  cin >> m;
  for (long long int i = 0; i < n; i++) {
    graph[i].clear();
  }
  visit.resize(n, 0);
  long long int x, y, flag = 0;
  for (long long int i = 0; i < m; i++) {
    cin >> x;
    cin >> y;
    x--;
    y--;
    graph[x].push_back(y);
    graph[y].push_back(x);
  }
  if (n != m) {
    cout << "NO\n";
    return 0;
  }
  dfs(0);
  for (long long int i = 0; i < n; i++) {
    if (!visit[i]) {
      flag = 1;
      break;
    }
  }
  if (flag == 1)
    cout << "NO\n";
  else
    cout << "FHTAGN!\n";
  return 0;
}
