7 7 7
1
2
3
4
5
6
7
 4 2 8
1
3
4
2
3
4
1
2
 9 4 9
1
2
3
4
5
6
7
8
9
 7 5 7
1
2
3
4
5
6
7
 15 10 15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 4 0 4
1
2
3
4
 12 2 12
1
2
3
4
5
6
7
8
9
10
11
12
 10 2 10
1
2
3
4
5
6
7
8
9
10
 7 4 7
1
2
3
4
5
6
7
 7 3 7
1
2
3
4
5
6
7

XXXXXXX
 ..XX.X.X
 ...X.X.XX
 .X.XXXX
 .X.X.X.X.XXXXXX
 ....
 .........X.X
 .......X.X
 .X.X.XX
 ...X.XX

#include <bits/stdc++.h>
char way[200][200];
int n, m;
char cc[200];
char vis[200];
int read_input() {
  int i, j;
  int a, b;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) way[i][j] = cc[j] = 0;
  scanf("%d %d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d %d", &a, &b);
    a--;
    b--;
    way[a][b] = way[b][a] = 1;
  }
  return 0;
}
int dfs(int u, int p) {
  int i, j;
  if (vis[u] == 1) return u;
  vis[u] = 1;
  for (i = 0; i < n; i++) {
    if (way[u][i] == 0 or i == p) continue;
    j = dfs(i, u);
    if (j >= 0 and j != u) {
      cc[u] = 1;
      return j;
    } else if (j == u) {
      cc[u] = 1;
      return -2;
    } else if (j == -2)
      return -2;
  }
  return -1;
}
int chkcy(int u, int p) {
  int i, j;
  vis[i] = 1;
  for (i = 0; i < n; i++) {
    if (way[u][i] == 0 or i == p or (cc[u] == 1 and cc[i] == 1)) continue;
    if (cc[u] == 0 and (vis[i] == 1 or cc[i] == 1)) return 1;
    j = chkcy(i, u);
    if (j == 1) return 1;
  }
  return 0;
}
int rch(int u, int p) {
  int i;
  if (vis[u] == 1) return 0;
  vis[u] = 1;
  for (i = 0; i < n; i++) {
    if (way[u][i] == 0 or i == p) continue;
    rch(i, u);
  }
  return 0;
}
int main() {
  int i, j, k;
  read_input();
  for (i = 0; i < n; i++) vis[i] = 0;
  rch(0, -1);
  for (i = 0; i < n; i++)
    if (vis[i] == 0) {
      printf("NO\n");
      return 0;
    }
  for (i = 0; i < n; i++) vis[i] = 0;
  j = dfs(0, -1);
  if (j == -1) {
    printf("NO\n");
    return 0;
  }
  for (i = 0; i < n; i++) vis[i] = 0;
  for (i = 0; i < n; i++) {
    if (vis[i] == 1 or cc[i] == 0) continue;
    if (chkcy(i, -1)) {
      printf("NO\n");
      return 0;
    }
  }
  printf("FHTAGN!\n");
  return 0;
}
