...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.

<image>

Input

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 ≤ <image>).

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.

Output

Print "NO", if the graph is not Cthulhu and "FHTAGN!" if it is.

Examples

Input

6 6
6 3
6 4
5 1
2 5
1 4
5 4


Output

FHTAGN!

Input

6 5
5 6
4 6
3 1
5 1
1 2


Output

NO

Note

Let us denote as a simple cycle a set of v vertices that can be numbered so that the edges will only exist between vertices number 1 and 2, 2 and 3, ..., v - 1 and v, v and 1.

A tree is a connected undirected graph consisting of n vertices and n - 1 edges (n > 0).

A rooted tree is a tree where one vertex is selected to be the root.
import java.io.*;
import java.util.*;

public class Main {

   // class Scanner {
   // StreamTokenizer in;
   //
   // Scanner(InputStream stream) {
   // in = new StreamTokenizer(new BufferedReader(new
   // InputStreamReader(stream)));
   // in.resetSyntax();
   // in.whitespaceChars(0, 32);
   // in.wordChars(33, 255);
   // }
   //
   // String next() {
   // try {
   // in.nextToken();
   // return in.sval;
   // } catch (Exception e) {
   // throw new Error();
   // }
   // }
   //
   // int nextInt() {
   // return Integer.parseInt(next());
   // }
   //
   // long nextLong() {
   // return Long.parseLong(next());
   // }
   //
   // double nextDouble() {
   // try {
   // in.nextToken();
   // return in.nval;
   // } catch (Exception e) {
   // throw new Error();
   // }
   // }
   // }

   Scanner in;
   PrintWriter out;

   void asserT(boolean e) {
      if (!e) {
         throw new Error();
      }
   }

   Node start;
   Node end;
   int gCnt = 0;

   class Node implements Comparable<Node> {
      int idx;
      TreeSet<Node> links = new TreeSet<Main.Node>();
      int color = 0;
      Node parent;

      Node(int idx) {
         this.idx = idx;
      }

      void addLink(Node link) {
         links.add(link);
      }

      void dfs2() {
         this.color = 1;
         for (Node link : links) {
            if (link.color == 0) {
               link.dfs2();
            }

         }
      }

      boolean dfs(Node prev) {
         this.color = 1;
         for (Node link : links) {
            if (link.color == 0) {
               link.parent = this;
               if (link.dfs(this)) {
                  return true;
               }
            } else if (link.color == 1 && link.idx != prev.idx) {
               end = this;
               start = link;
               return true;
            }
         }
         this.color = 2;
         return false;
      }

      boolean dfs3(Node prev) {
         if (setCycl.contains(this)) {
            gCnt++;
         }
         this.color = 1;
         for (Node link : links) {
            if (link.color == 0) {
               link.parent = this;

               if (link.dfs3(this)) {
                  return true;
               }
            } else if (link.color == 1 && link.idx != prev.idx) {
               end = this;
               start = link;
               return true;
            }
         }
         this.color = 2;
         return false;
      }

      @Override
      public int compareTo(Node second) {
         return this.idx - second.idx;
      }
   }

   TreeSet<Node> setCycl = new TreeSet<Main.Node>();
   String no = "NO";
   String yes = "FHTAGN!";

   void solve() {
      int nNodes = in.nextInt();
      int nLinks = in.nextInt();
      Node nodes[] = new Node[nNodes];
      for (int i = 0; i < nodes.length; i++) {
         nodes[i] = new Node(i + 1);
      }
      for (int i = 0; i < nLinks; i++) {
         int f = in.nextInt();
         int s = in.nextInt();
         nodes[f - 1].addLink(nodes[s - 1]);
         nodes[s - 1].addLink(nodes[f - 1]);
      }
      int nComponents = 0;
      for (Node node : nodes) {
         if (node.color == 0) {
            nComponents++;
            node.dfs2();
         }
      }
      if (nComponents != 1) {
         out.print(no);
         return;
      }
      for (Node node : nodes) {
         node.parent = null;
         node.color = 0;
      }
      start = null;
      end = null;
      for (Node node : nodes) {
         if (node.dfs(null)) {
            break;
         }
      }
      if (start == null) {
         out.print(no);
      } else {
         ArrayList<Node> cycl = new ArrayList<Main.Node>();
         cycl.add(start);
         setCycl.add(start);
         for (Node v = end; v.idx != start.idx; v = v.parent) {
            cycl.add(v);
            setCycl.add(v);
         }
         if (cycl.size() >= 3) {
            for (int i = 0; i < cycl.size(); i++) {
               Node cur = cycl.get(i);
               Node next = cycl.get((i + 1) % cycl.size());
               cur.links.remove(next);
               next.links.remove(cur);
            }
            for (Node node : nodes) {
               node.parent = null;
               node.color = 0;
            }
            start = null;
            end = null;
            for (Node node : nodes) {
               gCnt = 0;
               if (node.dfs3(null)) {
                  if (gCnt>1){
                     out.print(no);
                     return;
                  }
                  break;
               }
               if (gCnt>1){
                  out.print(no);
                  return;
               }
            }
            if (start == null) {
               out.print(yes);
            } else {
               out.print(no);
            }
         } else {
            out.print(no);
         }
      }
   }

   void run() {
      in = new Scanner(System.in);
      out = new PrintWriter(System.out);
      try {
         solve();
      } finally {
         out.close();
      }
   }

   public static void main(String[] args) {
      new Main().run();
   }
}