CSES - Game Routes
  • Time limit: 1.00 s
  • Memory limit: 512 MB

A game has nn levels, connected by mm teleporters, and your task is to get from level 11 to level nn. The game has been designed so that there are no directed cycles in the underlying graph. In how many ways can you complete the game?

Input

The first input line has two integers nn and mm: the number of levels and teleporters. The levels are numbered 1,2,,n1,2,\dots,n.

After this, there are mm lines describing the teleporters. Each line has two integers aa and bb: there is a teleporter from level aa to level bb.

Output

Print one integer: the number of ways you can complete the game. Since the result may be large, print it modulo 109+710^9+7.

Constraints

  • 1n1051 \le n \le 10^5
  • 1m21051 \le m \le 2 \cdot 10^5
  • 1a,bn1 \le a,b \le n

Example

Input:

4 5
1 2
2 4
1 3
3 4
1 4

Output:

3