~/algor $ cat problems/graf-qisqa-yollar-soni
Number of shortest paths
A city with $n$ intersections and $m$ two-way streets is given; driving along each street takes $1$ minute. How many different paths lead from intersection $1$ to intersection $n$ in the shortest time? Two paths are different if their sequences of streets differ. Print the answer modulo $10^{9} + 7$; if $n$ cannot be reached, print $0$.
Input
The first line contains two integers: $n$ and $m$. Each of the next $m$ lines contains two positive integers: $u$ and $v$ — the vertices joined by an edge.
Output
One integer — the number of shortest paths modulo $10^{9} + 7$.
Note
$2 \le n \le 10^{5}$
$0 \le m \le 2 * 10^{5}$
$1 \le u, v \le n$, $u \ne v$
There is at most one street between any pair of intersections.
Examples
6 7 1 2 1 3 2 4 3 4 4 6 2 5 5 6
3
4 2 1 2 3 4
0