#Lutece1309. Circular Table

Circular Table

Migrated from Lutece 1309 Circular Table

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

There are nn people sit around a circular table with nn seats.

It's obvious that there will be n!n! ways to arrange their position, but the arrangement does not go well, because there are some pairs of people who are unwilling to sit with the another.

More precisely, the people numbered from 11 to nn, and the relation of them can be described as mm unordered pairs {u,v}\{u,v\}, meaning that the people numbered uu and the people numbered vv will not sit in two adjacent positions.

The meaning of adjacent positions is, if we number seats from 11 to nn clockwise, the seat number ii is adjacent to the seat number i+1i+1 for all 1in11\leq i\leq n-1, in addition, the seat number nn is adjacent to the seat number 11.

How many ways to arrange their position while nobody is unwilling?

Input

The first line contains two integers nn and mm.

Then mm lines follow, each with two integers uu and vv. (uvu\neq v)

It is guaranteed that every relation is mentioned no more than once.

3n1063\leq n\leq 10^6

0m180\leq m\leq 18

1u,vn1\leq u, v \leq n

Output

Print the number of ways to arrange their position while nobody is unwilling. As the answer may be too large, output it modulo (109+7)(10^9+7) (i.e. if the answer is XX, you should output X % (109+7)X\ \%\ (10^9+7)).

Samples

4 0
24
4 1
1 2
8

Resources

The 14th UESTC Programming Contest Final