Rikka with Game Theory
题号:NC213953
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 512 M,其他语言1024 M
64bit IO Format: %lld

题目描述

Game theory is an interesting subject in computer science.
SG function is an important concept in game theory. Given a directed acyclic graph G_1 with vertex set V_1 and directed edge set E_1, for each vertex , its SG function sg(u) is defined as:

where given a set S of non-negative integers, is defined as the smallest non-negative integer which is not in S.
Today, Rikka wants to generalize SG function to undirected graphs. Given an undirected graph G with vertex set V and undirected edge set E, a function f over V is a valid SG function on G if and only if:
  • For each vertex , f(u) is a non-negative integer;
  • For each vertex , .
Under this definition, there may be many valid SG functions for a graph. Therefore, Rikka wants to further figure out whether there is a connection between these valid SG functions. As the first step, your task is to calculate the number of valid SG functions for a given undirected graph G.

输入描述:

The first line contains two integers , representing the number of vertices and edges in the graph.
Then m lines follow. Each line contains two integers , representing an edge in the graph.
The input guarantees that there are no loops and duplicate edges in the graph.

输出描述:

Output a single line with a single integer, representing the number of valid SG functions.

示例1

输入

复制
5 4
1 2
2 3
3 4
4 5

输出

复制
6

说明

For simplicity, we use list [f(1), \dots, f(n)] to represent a function f. 
For the sample input, there are 6 valid SG functions: [0,1,0,1,0], [0,1,2,0,1], [0,2,1,0,1], [1,0,1,0,1], [1,0,1,2,0] and [1,0,2,1,0].