You are given an integer and the following undirected graph:
- The graph contains nodes, which are numbered from to .
- There exists an undirected edge between two nodes and () if and only if .
There are distinct forbidden edges ().
Task
Find the number of simple paths in this graph from node to node that do not contain any of the forbidden edges. Since the answer can be very large, print its remainder modulo .
A simple path is a sequence of \textbf{pairwise distinct} nodes such that and are connected by an edge in the graph, for all .
Input data
The first line of input contains two integers and -- the number of nodes in the graph, and the number of forbidden edges, respectively.
Each of the next lines of input contains two integers and -- the endpoints of the forbidden edges.
Output data
Print the number of simple paths (modulo ) from node to node that do not contain any of the forbidden edges.
Constraints and clarifications
- .
- .
- , for each .
- The edges are pairwise distinct.
| # | Score | Constraints |
|---|---|---|
| 1 | 0 | Examples |
| 2 | 15 | , |
| 3 | 15 | |
| 4 | 20 | |
| 5 | 20 | |
| 6 | 30 | No additional restrictions |
Example 1
stdin
5 0
stdout
7
Explanation
In the first sample case, there are simple paths from node to node :
Example 2
stdin
5 1
3 4
stdout
4
Explanation
In the second sample case, there are simple paths from node to node that do not contain the edge :
Example 3
stdin
3 2
1 2
1 3
stdout
0
Explanation
In the third sample case, there are no simple paths from node to node that do not contain the edges and .
Example 4
stdin
8 6
4 5
6 7
6 8
1 2
2 3
2 4
stdout
2
Explanation
In the fourth sample case, there are only two valid simple paths from node to node :
Example 5
stdin
100 8
1 2
98 100
54 55
20 22
80 81
80 82
83 84
82 84
stdout
249047307
Example 6
stdin
2000000000 0
stdout
548668789