405588: GYM102006 A Hello SCPC 2018!

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Hello SCPC 2018!time limit per test1 secondmemory limit per test256 megabytesinputhello.inoutputstandard output

Here are some facts about the problem set of this contest:

  1. It consists of 12 problems written in English.
  2. The first 4 problems are the easiest according to their estimated difficulty.
  3. The first 4 problems are sorted in increasing order of their estimated difficulty.
  4. You should probably pause now and tell your teammates, especially the one who's reading problem K.
  5. The other 8 problems are harder than the first four, and they are ordered randomly.
  6. Our estimations for the difficulty of the problems may not apply to all contestants. So make sure to read all the problems and find the ones that are the most suitable for you and your team.

You are given the difficulties of 12 problems of some contest in their exact order in the problem set, from A to L. Determine whether they are ordered in the same way we ordered this problem set or not.

Input

The first line of input contains a single integer T (1 ≤ T ≤ 4096), the number of test cases.

Each of the following T lines represents one test case, and contains 12 distinct space-separated integers d1, d2, ..., d12 (1 ≤ di ≤ 100), where di is the estimated difficulty of the ith problem. A smaller di value represents an easier problem.

No two problems have the same estimated difficulty.

Output

For each test case, print a single line with "yes" if the given problems are ordered in the same way as in this contest, otherwise print "no".

ExampleInput
3
1 2 4 8 32 16 35 99 78 50 64 85
1 2 3 4 5 6 7 8 9 10 11 12
4 3 2 1 5 6 7 8 9 10 11 12
Output
yes
yes
no

加入题单

上一题 下一题 算法标签: