Problem2474--CF1750A - Indirect Sort

2474: CF1750A - Indirect Sort

[Creator : ]
Time Limit : 1.000 sec  Memory Limit : 128 MB

Description

Sample Input Copy

7
3
1 2 3
3
1 3 2
7
5 3 4 7 6 2 1
7
7 6 5 4 3 2 1
5
2 1 4 5 3
5
2 1 3 4 5
7
1 2 6 7 4 3 5

Sample Output Copy

Yes
Yes
No
No
No
No
Yes

HINT

Source/Category