...Once upon a time a man came to the sea. The sea was stormy and dark. The man started to call for the little mermaid to appear but alas, he only woke up Cthulhu...

Whereas on the other end of the world Pentagon is actively collecting information trying to predict the monster's behavior and preparing the secret super weapon. Due to high seismic activity and poor weather conditions the satellites haven't yet been able to make clear shots of the monster. The analysis of the first shot resulted in an undirected graph with *n* vertices and *m* edges. Now the world's best minds are about to determine whether this graph can be regarded as Cthulhu or not.

To add simplicity, let's suppose that Cthulhu looks from the space like some spherical body with tentacles attached to it. Formally, we shall regard as Cthulhu such an undirected graph that can be represented as a set of three or more rooted trees, whose roots are connected by a simple cycle.

It is guaranteed that the graph contains no multiple edges and self-loops.
The first line contains two integers — the number of vertices *n* and the number of edges *m* of the graph (1 ≤ *n* ≤ 100, 0 ≤ *m* ≤ <img align="middle" class="tex-formula" src="https://espresso.codeforces.com/b6fbba87a6e66854e5728f67cc384b75c4bcf131.png" style="max-width: 100.0%;max-height: 100.0%;"/>).

Each of the following *m* lines contains a pair of integers *x* and *y*, that show that an edge exists between vertices *x* and *y* (1 ≤ *x*, *y* ≤ *n*, *x* ≠ *y*). For each pair of vertices there will be at most one edge between them, no edge connects a vertex to itself.
6 6
6 3
6 4
5 1
2 5
1 4
5 4
FHTAGN!
6 5
5 6
4 6
3 1
5 1
1 2
NO
10 10
4 10
8 5
2 8
4 9
9 3
2 7
10 6
10 2
9 8
1 8
FHTAGN!
5 4
1 5
1 3
1 4
3 2
NO
12 12
4 12
4 7
4 9
7 2
5 12
2 1
5 9
8 6
10 12
2 5
10 9
12 3
NO
12 15
3 2
11 12
1 9
2 1
1 8
9 6
11 5
9 5
9 10
11 3
7 11
5 6
11 10
4 6
4 2
NO
12 10
1 11
3 6
5 7
4 7
6 8
11 7
3 12
11 12
7 9
12 2
NO
1 0
NO
2 1
1 2
NO
3 1
1 3
NO
3 2
1 2
2 3
NO
3 3
1 2
2 3
3 1
FHTAGN!
4 4
1 2
3 4
4 1
2 4
FHTAGN!
6 6
1 2
2 3
3 1
4 5
5 6
6 4
NO
2 0
NO
3 0
NO
100 0
NO
100 1
11 23
NO
10 10
5 7
8 1
10 3
6 4
10 6
5 3
5 6
2 6
4 3
2 10
NO
20 20
9 10
4 19
9 20
12 20
1 15
2 12
19 10
19 15
4 10
4 8
8 9
20 8
6 2
2 15
7 19
20 4
3 16
1 20
9 1
20 10
NO
30 30
17 6
16 29
16 13
16 20
29 26
17 5
27 28
24 16
7 18
24 10
1 27
12 17
27 30
6 1
3 30
5 19
18 13
16 2
30 1
5 8
14 16
26 18
7 19
5 6
23 14
6 8
23 8
18 8
18 3
5 21
NO
100 66
41 14
19 13
70 43
79 62
9 62
71 40
53 86
80 4
34 33
72 68
40 96
84 59
36 77
55 50
40 3
79 81
3 43
33 47
22 98
33 90
56 49
69 28
73 30
65 22
98 20
9 52
54 20
32 70
51 80
63 12
21 48
35 17
48 87
25 43
65 80
42 3
86 35
95 98
43 59
51 46
66 37
88 34
32 47
24 42
21 44
92 59
81 6
100 82
85 6
58 25
66 6
14 32
59 85
3 98
44 4
85 51
69 41
80 70
81 24
75 71
93 9
82 55
70 46
66 32
77 58
11 46
NO
4 4
1 2
4 3
2 3
3 1
FHTAGN!
5 5
2 3
2 4
5 4
4 1
1 2
FHTAGN!
10 10
1 10
5 9
6 2
8 9
9 1
5 4
2 8
1 3
6 3
4 1
NO
6 6
1 2
2 3
3 1
4 5
5 6
6 4
NO
4 3
1 2
2 3
3 1
NO
6 5
1 2
2 3
3 1
1 4
1 5
NO

#?		 /\_/\
#?		(= ._.)
#?		/ >WA \>AC
#// WELCOME TO MY CODING SPACE
#!  Filename: nhap.py
#?  Author: TranDucTri2003
#*  CreatedAt: 2022-05-01 22:55:01

from collections import defaultdict
from heapq import heappop, heappush

class Graph:
    INF=10**9
    #Searching Algorithms: DFS, BFS
    def __init__(self):
        self.graph = defaultdict(list)
        
    # Algorithms for finding the shortest path: Bellman Ford
    # def __init__(self, vertices):
    #     self.V = vertices # No. of vertices
    #     self.graph = []

    # Algorithms for finding the shortest path: Dijsktra
    # def __init__(self,vertices):
    #     self.distance=[self.INF]*vertices
    #     self.edges=defaultdict(dict)

    # Algorithms for finding the shortest path: Floyd Warshall    
    # def __init__(self,vertices):
    #     self.distance=defaultdict(lambda:defaultdict(lambda:self.INF))
    #     self.edges=defaultdict(lambda:defaultdict(lambda:self.INF))
    #     for i in range(1,vertices+1):
    #         self.distance[i][i]=0
    #         self.edges[i][i]=0
    
    #Minimum Spanning Trees: Kruskal's Algorithm
    # def __init__(self, vertices):
    #     self.vertices=vertices
    #     self.graph=[]
    

        
    #DFS,BFS
    def addEdge(self,u,v):
        self.graph[u].append(v)
        self.graph[v].append(u)
        
    #Bellman Ford
    # def addEdge(self, u, v, w):
    #     self.graph.append([u, v, w])
    
    #Dijsktra
    # def addEdge(self,u,v,w):
    #     self.edges[u][v]=w
        
    #Floyd Warshall
    # def addEdge(self,u,v,w):
    #     self.edges[u][v]=w
    
    #:Kruskal's Algorithm finding MST
    # def addEdge(self,node1,node2,weight):
    #     self.graph.append([node1,node2,weight])
                    
    # 1.Handling A Disconnected Graph: 
    def DFSUtil(self, vertex,visited,path):
        stack=[vertex]
        while len(stack):
            u=stack.pop()
            if visited[u]==0:
                path.append(u)
                visited[u]=1
                for neighbour in self.graph[u]:
                    stack.append(neighbour)
                    
    # def DFS(self,numVertex):
    #     visited=defaultdict(lambda:0)
    #     path=[]
    #     for vertex in range(1,numVertex+1):
    #         if visited[vertex]==0:
    #             self.DFSUtil(vertex,visited,path)        
    #     return path
                
    # 2.DFS from a vertex 
    def DFS(self,vertex):
        path=[]
        stack=[vertex]
        visited=defaultdict(lambda:0)
        ancestor=defaultdict(lambda:0)
        while len(stack):
            u=stack.pop()
            if visited[u]==0:
                path.append(u)
                visited[u]=1
                for neighbour in self.graph[u]:
                    ancestor[neighbour]=u
                    if visited[neighbour]==1 and ancestor[u]!=neighbour:
                        return 1
                    else:
                        stack.append(neighbour)
        return 0
                

                
    # 1. Handling A Disconnected Graph:
    def BFS(self,numVertex):
        visited=defaultdict(lambda:0)
        queue=[]
        for i in range(1,numVertex+1):
            if visited[i]==0:
                queue.append(i)
                visited[i]=1
                while queue:
                    u=queue.pop(0)
                    print(u,end=' ')
                    for v in self.graph[u]:
                        if visited[v]==0:
                            queue.append(v)
                            visited[v]=1
                            
    # 2. BFS from a vertex
    # def BFS(self,vertex):
    #     visited = defaultdict(lambda:0)
    #     queue=[vertex]
    #     visited[vertex]=1
    #     path=[]
    #     while queue:
    #         u=queue.pop(0)
    #         path.append(u)
    #         for v in self.graph[u]:
    #             if visited[v]==0:
    #                 queue.append(v)
    #                 visited[v]=1
    #     return path
        
    #DFSUtil in case finding Connected components
    def DFSUtilConnect(self, temp, v, visited):
        visited[v] = 1
        # Store the vertex to list
        temp.append(v)
        for neighbour in self.graph[v]:
            if visited[neighbour]==0:
                # Update the list
                temp = self.DFSUtilConnect(temp, neighbour, visited)
        return temp
    
          
    def connectedComponentsDFS(self,numVertex):
        path=[]
        visited=defaultdict(lambda:0)
        for vertex in range(1,numVertex+1):
            if visited[vertex] == 0:
                temp = []
                path.append(self.DFSUtilConnect(temp, vertex, visited))
        return path
      
    def connectedComponentsBFS(self,numVertex):
        visited=defaultdict(lambda:0)
        stack=[]
        path=[]
        for i in range(1,numVertex+1):
            if visited[i]==0:
                stack.append(i)
                visited[i]=1
                temp=[]
                while stack:
                    u=stack.pop()
                    temp.append(u)
                    for v in self.graph[u]:
                        if visited[v]==0:
                            stack.append(v)
                            visited[v]=1
                path.append(temp)
        return path
                  
    

    def BellmanFord(self, S):
        d=defaultdict(lambda:self.INF)
        trace=defaultdict(lambda:-1)
        d[S]=0
 
        for _ in range(self.V - 1):
            for u, v, w in self.graph:
                if d[u]!=self.INF and d[v]>d[u]+w:
                    d[v]=d[u]+w
                    trace[v]=u

        #Trả về đường đi từ đỉnh S đến u nào đó
        #return trace
        # if u!=S and trace[u]==-1:
        #     return -1 #Không có đường đi
        # else:
        #     path=[]
        #     while u!=-1:
        #         path.append(u)
        #         u=trace[u]
        #     path.reverse()
        #     return path

        #Nhận biết đường đi âm vô cực trong trường hợp có chu trình âm:
        
        # Chạy thuật toán Bellman-Ford thêm một lần nữa với N vòng lặp, những đỉnh nào vẫn còn tối ưu được ở lần chạy thứ hai
        # sẽ tối ưu được mãi mãi, và đó là các đỉnh không tồn tại đường đi ngắn nhất.
        
        for _ in range(self.V):
            for u, v, w in self.graph:
                if d[u]!=self.INF and d[v]>d[u]+w:
                    d[v]=-self.INF  # vẫn còn tối ưu được --> âm vô cực
                    trace[v]=u
        return d
    
    def Dijsktra(self,S):
        self.distance[S]=0
        queue=[(0,S)]
        trace=defaultdict(lambda:-1)
        while queue:
            cost,vertex=heappop(queue)
            for neighbour, weight in self.edges[vertex].items():
                if cost+weight<self.distance[neighbour]:
                    self.distance[neighbour]=cost+weight
                    heappush(queue, (cost + weight, neighbour))
                    trace[neighbour]=vertex
        #Trả về đường đi từ đỉnh S đến u nào đó
        #return trace
        # if u!=S and trace[u]==-1:
        #     return -1 #Không có đường đi
        # else:
        #     path=[]
        #     while u!=-1:
        #         path.append(u)
        #         u=trace[u]
        #     path.reverse()
        #     return path 
        return self.distance
    
    def FloydWarshall(self,vertices):
        for k in range(1,vertices+1):
            for i in range(1,vertices+1):
                for j in range(1,vertices+1):
                   self.distance[i][j]=min(self.distance[i][j],self.edges[i][k]+self.edges[k][j])
        return self.distance


    #Finds the root of a subtree containing node 'i'
    def findSubtree(self,parent,i):
        if parent[i]==i:
            return i
        else:
            return self.findSubtree(parent,parent[i])
    #Connects subtrees containing node 'x' and 'y'
    def connectSubtree(self,parent,subtreeSize,x,y):
        xroot=self.findSubtree(parent,x)
        yroot=self.findSubtree(parent,y)
        if subtreeSize[xroot]<subtreeSize[yroot]:
            parent[xroot]=yroot
        elif subtreeSize[xroot]>subtreeSize[yroot]:
            parent[yroot]=xroot
        else:
            parent[yroot]=xroot
            subtreeSize[xroot]+=1
        
    def Kruskal(self):
        #Resulting tree
        res=[]
        
        #Iterator
        i=0
        #Number of edges in MST
        e=0

        #Sort edges by their weight
        self.graph=sorted(self.graph,key=lambda item: item[2])

        #Auxiliary arrays
        parent=[]
        subtreeSize=[]
        
        #initialize parent and subtreeSize arrays
        
        for node in range(self.vertices):
            parent.append(node)
            subtreeSize.append(0)
        
        #Number of edges in a MST is (node-1)
        
        while e<self.vertices-1:
            node1,node2,weight=self.graph[i]
            i+=1

            x=self.findSubtree(parent,node1)
            y=self.findSubtree(parent,node2)
            
            if x!=y:
                e+=1
                res.append([node1,node2,weight])
                self.connectSubtree(parent,subtreeSize,node1,node2)
        return res


    def isEulerian(self):
        path=self.connectedComponentsBFS(self.v)
        for compo in path:
            odd=0
            for vertex in compo:
                if self.degree[vertex]%2==1:
                    odd+=1

        if odd == 0:
            return 2   # graph has a Euler cycle
        elif odd == 2:
            return 1  # graph has a Euler path
        elif odd > 2:
            return 0   # graph is not Euleria
            # '''If odd count is 2, then semi-eulerian.
            # If odd count is 0, then eulerian
            # If count is more than 2, then graph is not Eulerian
            # Note that odd count can never be 1 for undirected graph'''

n,m=list(map(int,input().split()))
g=Graph()
for i in range(m):
    u,v=list(map(int,input().split()))
    g.addEdge(u,v)

com=g.connectedComponentsDFS(n)
if len(com)==1 and g.DFS(1)==1:
    print("FHTAGN!")
else:
    print("NO")

#Nếu đi đến một đỉnh mà đỉnh đó đã được thăm nhưng tổ tiên của nó không phải là đỉnh đó nghĩa là có chu trình