Ikshu and his class

Ikshu's class is very fond of playing games. Their teacher tied them with many ropes with each other, Such that each student is tied with exactly one rope. It means that if students 2 and 3 are connected and 2 is connected to 4 as well then 2,3 and 4 must be sharing the same rope.

Now, teacher asks them to divide themselves in group. One group for each rope, each group consists of the students tied to that particular rope. Each group exchanges gifts among themselves (each student is having exactly one gift before and after the game).

What is the total number of distinct exchanges possible ? Two exchanges are distinct if there is atleast one student having different gift with him.

NOTE: It is also possible that a student has same gift after exchanging as he had before exchanging.  There might be a case where no exchange took place i.e each student is having same gift after exchanging as he was having before exchange.

Input: 
First line of input contains two integers N and K, where N is the number of students and K is the number of connections between students. Next K lines contains two integers which are the indices(0 based) of students connected by a rope. 

Output:
Print a single integer which is the total number of exchanges possible modulus (10^9 + 7)

Constraints:
1 ≤ N ≤ 100000
1 ≤ K ≤ 100000

SAMPLE INPUT
5 2
1 2
3 4

SAMPLE OUTPUT
4

Explanation

0 is alone, [1,2] and [3,4] are tied to same rope.
Now, 0 cannot share gift with anyone whereas [1,2] can has two possible distinct exchanges
a) where 1 and 2 exchange gifts
b) where they do not exchange gift.
Same for [3,4]

So, there are 2*2 = 4 different states possible at the end.
class DisjointSet(object):

    def __init__(self):
        self.leader = {} # maps a member to the group's leader
        self.group = {} # maps a group leader to the group (which is a set)

    def add(self, a, b):
        leadera = self.leader.get(a)
        leaderb = self.leader.get(b)
        if leadera is not None:
            if leaderb is not None:
                if leadera == leaderb: return # nothing to do
                groupa = self.group[leadera]
                groupb = self.group[leaderb]
                if len(groupa) < len(groupb):
                    a, leadera, groupa, b, leaderb, groupb = b, leaderb, groupb, a, leadera, groupa
                groupa |= groupb
                del self.group[leaderb]
                for k in groupb:
                    self.leader[k] = leadera
            else:
                self.group[leadera].add(b)
                self.leader[b] = leadera
        else:
            if leaderb is not None:
                self.group[leaderb].add(a)
                self.leader[a] = leaderb
            else:
                self.leader[a] = self.leader[b] = a
                self.group[a] = set([a, b])
ds= DisjointSet()

n,k=map(int,raw_input().split())
for i in xrange(k):
    u,v=map(int,raw_input().split())
    ds.add(u,v)
#print ds.group.values()
#comps=[]
#for i in ds.group.values():
#    comps.append(len(i))
#mc=max(comps)

def egcd(a, b):
    x,y, u,v = 0,1, 1,0
    while a != 0:
        q,r = b//a,b%a; m,n = x-u*q,y-v*q # use x//y for floor "floor division"
        b,a, x,y, u,v = a,r, u,v, m,n
    return b, x, y

def modinv(a, m):
    g, x, y = egcd(a, m) 
    if g != 1:
        return None
    else:
        return x % m

def factorialMod(n, modulus):
    ans=1
    if n <= modulus//2:
        #calculate the factorial normally (right argument of range() is exclusive)
        for i in xrange(1,n+1):
            ans = (ans * i) % modulus   
    else:
        #Fancypants method for large n
        for i in xrange(1,modulus-n):
            ans = (ans * i) % modulus
        ans = modinv(ans, modulus)

        #Since m is an odd-prime, (-1)^(m-n) = -1 if n is even, +1 if n is odd
        if n % 2 == 0:
            ans = -1*ans + modulus
    return ans % modulus
ans=1
#facs=[0]*(mc)
#temp=1
    
#for i in xrange(1,mc+1):
#	temp*=i%1000000007
#	facs[i-1]=temp%1000000007

for c in ds.group.values():
    ans*=factorialMod(len(c),1000000007)
print ans%1000000007