Under construction

Still being built. Things may change

Y

Interview

Time limit1sMemory limit1024 MB

Summary
Count the Y shapes in an undirected graph, where a root vertex has three edges to three leaves, modulo 10^9+7.
Level

Easy3 of 10

Topics
Combinatorics, Graph
Solved
No attempts yet

Problem

Hujaro is studying graph theory and found an interesting graph. Call a simple undirected graph a Y if it has the following properties:

  • It has 4 vertices and 3 edges.
  • One vertex is called the root, and the other 3 vertices are called leaves.
  • Each of the 3 edges connects one leaf to the root.

Hujaro thinks the properties of Y are very unusual, so he decided to count how many Ys appear in a given graph. In a simple undirected graph, the number of Ys is defined as follows:

  • Choose 3 edges from the graph without regard to order. If these edges, together with the vertices they connect, form a Y, that choice counts once. The number of Ys in the graph is the number of such choices.

Given a simple undirected graph, print the number of Ys in it. The count can be very large, so print the remainder when it is divided by 109+710^{9}+7.

Input

The first line contains the number of vertices nn and the number of edges mm, separated by a space. (1≤n≤1051 \le n \le 10^5, 0≤m≤min⁡(n(n−1)2,2×105)0 \le m \le \min(\frac{n(n-1)}{2},2\times 10^5))

Each of the next mm lines contains two vertices uu and vv connected by an edge, separated by a space. (1≤u,v≤n1 \le u,v \le n, u≠vu \neq v)

The graph has no multiple edges and no edges whose two endpoints are the same vertex.

Output

Print the number of Ys in the given graph, modulo 109+710^{9}+7.

Examples1

  1. Example 1

    Input
    4 6
    1 2
    1 3
    1 4
    2 3
    2 4
    3 4
    
    Expected output
    4