#P16128. [ICPC 2018 NAIPC] Double Clique

[ICPC 2018 NAIPC] Double Clique

题目描述

You are given an undirected graph GG with nn nodes and mm edges. The set of vertices is VV and the set of edges is EE.

Let the Complement of GG be GG'. The Complement of a graph is a graph with all of the same nodes, but if there’s no edge between nodes aa and bb in GG, then there is an edge between aa and bb in GG', and if there is an edge between aa and bb in GG, then there is no edge between aa and bb in GG'.

A Clique is a subset of nodes that have an edge between every pair. A subset of nodes SS is called a Double Clique if SS forms a clique in GG, and VSV - S forms a clique in GG'. Note that an empty set of nodes is considered a clique.

Given a graph, count the number of double cliques in the graph modulo 109+710^9 + 7.

输入格式

Each input will consist of a single test case. Note that your program may be run multiple times on different inputs. Each test case will begin with a line with two integers nn and mm (1n,m2×1051 \leq n, m \leq 2 \times 10^5), where nn is the number of nodes and mm is the number of edges in the graph. The nodes are numbered 1..n1..n. Each of the next mm lines will contain two integers aa and bb (1a<bn1 \leq a < b \leq n), representing an edge between nodes aa and bb. The edges are guaranteed to be unique.

输出格式

Output a single integer, which is the number of Double Cliques in the graph modulo 109+710^9 + 7.

3 3
1 3
1 2
2 3
4