#c22905. 路径数量统计

路径数量统计

Path Counting

Problem Description

You are given a directed graph (which may contain multiple edges and self-loops). Count the number of walks that start at vertex uu, use exactly kk edges, and end at vertex vv. Since the answer may be very large, output it modulo 109+710^9 + 7.

Input Format

The first line contains two integers n,mn, m, the number of vertices and edges, respectively.

The next mm lines each contain two integers x,yx, y, indicating a directed edge from xx to yy.

The last line contains three integers u,v,ku, v, k, the query.

Output Format

Output one line containing a single integer: the answer modulo 109+710^9 + 7.

Sample Input

2 3
1 2
2 1
1 1
1 2 3

Sample Output

2

Constraints

For 100%100\% of the test cases, 1≤n≤2001 \le n \le 200, 1≤m≤1041 \le m \le 10^4, 1≤x,y,u,v≤n1 \le x, y, u, v \le n, 1≤k≤1091 \le k \le 10^9.