Counting Cycles

A connected undirected graph with n vertices and at most n+15 edges is given; count all simple cycles, where a simple cycle is a connected subgraph with every degree exactly two.

Hard9GraphDFSCombinatoricsImplementationNo attempts yetTime limit4sMemory limit512 MB

Problem

You are given an undirected graph. Count the simple cycles in it. A simple cycle is a connected subgraph in which every vertex has degree exactly two.

Input

The input is one test case in the following format.

n m
u_1 v_1
...
u_m v_m

The test case describes an undirected graph GG.

The first line has the number of vertices nn (3n1000003 \le n \le 100000) and the number of edges mm (n1mn+15n - 1 \le m \le n + 15). The vertices are numbered 1 to nn.

Each of the next mm lines describes one edge. The two integers uiu_i and viv_i on the ii-th of these lines mean that an edge joins vertex uiu_i and vertex viv_i. You may assume ui<viu_i < v_i, so no edge is a self loop.

For every pair iji \ne j, either uiuju_i \ne u_j or vivjv_i \ne v_j holds, so the graph has no parallel edges.

You may assume that GG is connected.

Output

Print one line containing the number of simple cycles in the graph.