You are given an undirected graph with vertices and edges. The edges are numbered from to , and edge () connects vertices and . The graph does not contain self-loops, i.e., for all .
A partial graph of is a graph obtained by selecting a subset of the edges of . In particular, for any , we define as the partial graph containing all edges with indices between and , inclusive.
A graph is called bipartite if its vertex set can be partitioned into two subsets and such that there are no edges between any two vertices within the same subset.
Your task is to count the number of bipartite partial graphs of the form . Formally, compute
where if is bipartite, and otherwise.
Input data
The input consists of:
- One line containing two integers and – the number of vertices and the number of edges, respectively.
- subsequent lines, where the -th line contains two integers and , describing edge .
Output data
The output file must contain a single line consisting of 64-bit integer, the number of bipartite graphs.
Constraints and clarifications
- .
- .
- , and for each such that .
| # | Score | Constraints |
|---|---|---|
| 1 | 0 | Examples. |
| 2 | 10 | . |
| 3 | 7 | . |
| 4 | 10 | . |
| 5 | 20 | . |
| 6 | 14 | . |
| 7 | 20 | . |
| 8 | 19 | No additional constraints. |
Example 1
stdin
3 3
1 2
1 3
2 3
stdout
5
Explanation
In the first sample case graph is displayed in the following figure.

The bipartite graphs are , , , , . Note that is not bipartite.
Example 2
stdin
6 8
1 5
5 4
3 4
1 3
1 4
5 6
2 5
2 6
stdout
21
Explanation
In the second sample case we have the following graph .

The bipartite graphs are , , , , , , , , , , , , , , , , , , , , . A few examples of invalid partial graphs are , , , and .