SP10573 OFFSTRAT - Problem Offensive Strategy
Description
Foo Football Club is a very offensive soccer team. Its coach is planing a new attack strategy.
In order not to change its image of offensive team, the coach wants to be sure that the new attack strategy is going to be strongly offensive. He is a very grumpy coach so he does not allow the players to make a pass that is not in the strategy sheet. In fact he is so mad that he does not allow the player who holds the ball to move.
A attack strategy is strongly offensive if each football pass position inside the field goes to another football pass position inside the field which is in the same distance or closer to the enemy line of goal, and also it should be possible to reach the enemy goal from every pass position described in the strategy sheet.
Input Format
The first line of input consist of a number T (T
Output Format
For each test case the output should consist of a single line containing “Yes” (without quotes) if the strategy is strongly offensive or “No” (without quotes) otherwise.