...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.awt.*;
import java.io.*;
import java.math.*;
import java.util.*;
import static java.lang.Math.*;

public class BetaRound80_Div1_B implements Runnable {

    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    public static void main(String[] args) {
        new Thread(null, new BetaRound80_Div1_B(), "", 256 * (1L << 20)).start();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            if (System.getProperty("ONLINE_JUDGE") != null) {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            } else {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            }
            Locale.setDefault(Locale.US);
            solve();
            in.close();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Throwable t) {
            t.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    /** http://pastebin.com/j0xdUjDn */
    static class Utils {

        private Utils() {}

        public static void mergeSort(int[] a) {
            mergeSort(a, 0, a.length - 1);
        }

        private static final int MAGIC_VALUE = 50;

        private static void mergeSort(int[] a, int leftIndex, int rightIndex) {
            if (leftIndex < rightIndex) {
                if (rightIndex - leftIndex <= MAGIC_VALUE) {
                    insertionSort(a, leftIndex, rightIndex);
                } else {
                    int middleIndex = (leftIndex + rightIndex) / 2;
                    mergeSort(a, leftIndex, middleIndex);
                    mergeSort(a, middleIndex + 1, rightIndex);
                    merge(a, leftIndex, middleIndex, rightIndex);
                }
            }
        }

        private static void merge(int[] a, int leftIndex, int middleIndex, int rightIndex) {
            int length1 = middleIndex - leftIndex + 1;
            int length2 = rightIndex - middleIndex;
            int[] leftArray = new int[length1];
            int[] rightArray = new int[length2];
            System.arraycopy(a, leftIndex, leftArray, 0, length1);
            System.arraycopy(a, middleIndex + 1, rightArray, 0, length2);
            for (int k = leftIndex, i = 0, j = 0; k <= rightIndex; k++) {
                if (i == length1) {
                    a[k] = rightArray[j++];
                } else if (j == length2) {
                    a[k] = leftArray[i++];
                } else {
                    a[k] = leftArray[i] <= rightArray[j] ? leftArray[i++] : rightArray[j++];
                }
            }
        }

        private static void insertionSort(int[] a, int leftIndex, int rightIndex) {
            for (int i = leftIndex + 1; i <= rightIndex; i++) {
                int current = a[i];
                int j = i - 1;
                while (j >= leftIndex && a[j] > current) {
                    a[j + 1] = a[j];
                    j--;
                }
                a[j + 1] = current;
            }
        }

    }

    // solution

    int n;
    boolean[][] a;
    int[] vis;
    int[] p;
    
    void solve() throws IOException {
        n = readInt();
        int m = readInt();
        if (n != m) {
            out.println("NO"); // missed it
            return;
        }
        a = new boolean[n][n];
        for (int i = 0; i < m; i++) {
            int x = readInt() - 1;
            int y = readInt() - 1;
            a[x][y] = a[y][x] = true;
        }
        vis = new int[n];
        p = new int[n];
        //boolean[][] tmp = a.clone(); // OH IT WORKS WRONG
        boolean[][] tmp = new boolean[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                tmp[i][j] = a[i][j];
            }
        }
        for (int i = 0; i < n; i++) {
            if (vis[i] == 0) dfs(i); // find cycle
        }
        a = tmp;
        if (ca == -1) {
            out.println("NO");
            return;
        }
        a[ca][cb] = a[cb][ca] = false; // now it's a tree
        Arrays.fill(vis, 0);
        if (!dfs2(ca)) { // try to find another cycle
            out.println("NO");
            return;
        }
        for (int i = 0; i < n; i++) {
            if (vis[i] == 0) {
                out.println("NO");
                return;
            }
        }
        if (path.size() < 3) {
            out.println("NO");
        } else {
            out.println("FHTAGN!");
        }
    }
    
    int ca = -1, cb = -1;
    ArrayList<Integer> path = new ArrayList<Integer>();
    
    void dfs(int v) {
        vis[v] = 1;
        for (int i = 0; i < n; i++) {
            if (a[v][i]) {
                p[i] = v;
                if (vis[i] == 1) {
                    if (ca == -1) {
                        ca = v;
                        cb = i;
                        for (int k = v; k != i; k = p[k]) {
                            path.add(k);
                        }
                        path.add(i);
                    }
                }
                if (vis[i] == 0) {
                    a[i][v] = false;
                    dfs(i);
                }
            }
        }
        vis[v] = 2;
    }
    
    boolean dfs2(int v) {
        vis[v] = 1;
        for (int i = 0; i < n; i++) {
            if (a[v][i]) {
                if (vis[i] == 1) {
                    return false;
                }
                if (vis[i] == 0) {
                    a[i][v] = false;
                    if (!dfs2(i)) return false;
                }
            }
        }
        vis[v] = 2;
        return true;
    }

}
