H - The Problem to Make You Happy

Description

Alice and Bob are good friends, as in every other storyline. One day Alice and Bob are playing an interesting game. The game is played on a directed graph with n vertices and m edges, Alice and Bob have exactly one chess piece each. Initially, Bob’s chess piece is placed on vertex x, while Alice’s chess piece is placed at vertex y. Bob plays first, then Alice, then Bob, then Alice and so on.
During each move, the player must move his/her chess piece from the vertex his/her chess piececurrently at to an adjacent vertex, by traveling through exactly one directed edge.(Remember that the game is played on a directed graph.) If someone can’t make such a move, he/she will be considered to lose the game.
There’s one additional rule: at any time, if Bob and Alice’s chess pieces are at the same vertex,then Alice is consider to be the winner and the game ends up immediately.
Now you are given the initial situation, could you determine who is the winner? Please note that neither Bob nor Alice will make any mistakes during the game, i.e. they both play optimally. In case that the game never ends up, Bob is considered to be the winner.

Input

The first line of the input gives the number of test cases, T. T test cases follow.
For each test case, the first line contains two integers n and m ( $2 ≤ n ≤ 100, 1 ≤ m ≤ n × (n − 1)$ ).
Next m lines, each line contains two integers b and e, indicating there is one directed edge from vertex
b to vertex e. Last line contains two integers x and y ( $1 ≤ x, y ≤ n, x \ne y$ ), which are Bob and Alice’s
initial position. The graph contains no self-loops or duplicate edges.

Output

For each test case output one line ‘Case #x: y’, where x is the case number (starting from 1) and y
is ‘Yes’ (without quotes) if Bob can win or the game never ends up, otherwise ‘No’ (without quotes).

Sample Output

1.棋子重合, $dp[i][i][0]=1$ 和 $dp[i][i][1]=1$ ( $1 ≤i≤ n$ )

2.有一人无法行动，即对于所有出度为0的点 $v$ ， $dp[v][i][0]=1,dp[i][v][1]=0$

Bob行动时会尽可能选择所有Alice的必败态：

Alice行动时会尽可能选择所有Alice的必胜态：