Mock CCC '21 S5 - Clique and Independent Set

View as PDF

Submit solution

Points: 25 (partial)
Time limit: 0.25s
Memory limit: 1G

Problem types

You are given an undirected graph of N vertices and M edges. Compute the number of subsets of vertices which are cliques, where the vertices not in the subset form an independent set.


1 \le N, M \le 2 \cdot 10^5

Input Specification

The first line contains two space-separated integers, N and M.

Each of the next M lines contain two space-separated integers, a and b, indicating an edge between a and b. The input is guaranteed to contain no self-loops or parallel edges.

Output Specification

Count the number of valid subsets modulo 10^9 + 7.

Sample Input

3 3
1 2
1 3
2 3

Sample Output



There are no comments at the moment.