#include <bits/stdc++.h>
const int MAXN = 110;
int n, m;
int f[MAXN];
int getf(int p) { return f[p] == p ? p : f[p] = getf(f[p]); }
int main() {
  scanf("%d %d\n", &n, &m);
  int i, s, t;
  if (n == 1 || n != m) {
    printf("NO\n");
    return 0;
  }
  for (int i = 1; i <= n; ++i) f[i] = i;
  int c = 0;
  for (int i = 1; i <= m; ++i) {
    scanf("%d %d", &s, &t);
    if (getf(s) != getf(t)) {
      f[getf(s)] = getf(t);
    } else {
      if (c) {
        printf("NO\n");
        return 0;
      }
      ++c;
    }
  }
  printf("FHTAGN!\n");
  return 0;
}
