spoj#TEMPLE01. TEMPLE_RUN

TEMPLE_RUN

The city of Forum Boarium is full of temples . Unlike other cities the temples are built in a circular fashion in Forum Boarium & each of these temples consists of exactly three floors. These floors are assigned a label,which is nothing but an English Alphabet.The speciality of the Circular arrangement of temples is that ,standing in any temple , we could see all other temples in the city . But over the years,all the temples have lost their sacredness except one .

Hercules arrives to this city, and wishes to visit the temple which is still sacred. An old wicked friend of Hercules leads him to the ground floor of the temple ,T1But knowing the nature of his wicked friend ,Hercules consults the old - aged people over there and finds the temple which still has its divine power ( T2 ). In order to reach T2 there are  only two possible moves Hercules could do :

(i)Either shift between the floors of the same temple (or),

(ii)Jump between the same indexed floors( having same labels ) of two different temples . Some old ritual also says that, the labels of the corresponding floors other than the chosen one for jumping , must differ.

Input

The first line contains an integer t ( 1<=t<=10),the number of scenarios

t scenarios follow :

The first line of each scenario contains an integer N ( 2<=N<=3000), the number of temples. ( The temples are numbered from 1 to N ).

Each of the following N lines cotains the labels of the floors : a1,a2,a3 ( from bottom to top ).

The next line contains two integers :

T1 ( 1<=T1<=N ),the index of the temple he is currently in & T2 ( 1<= T2 <=N),the index of the temple which is still divine.

Output

For each scenario print a single line - "Yes." , if the sacred temple could be reached , or otherwise "No.".

Example

Input:
1
3
a f r
a t p
x t m
1 3

 Output: Yes.