409871: GYM103821 C Perfect Seating

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

Description

C. Perfect Seatingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Ammar teaches programming for kindergarteners. The classroom consists of $$$N$$$ desks such that they are put in front of each other, desks are indexed with numbers from $$$1$$$ to $$$N$$$, the desk with index $$$1$$$ is the first one, then desk $$$2$$$ comes behind it and so on..

There are $$$N$$$ children attending Ammar's programming lectures with distinct heights, child $$$i$$$ will sit in desk $$$i$$$, each child has a specific height. A child can see the board clearly if he sits in the first desk, or if he sits in a desk such that all children in front of him have heights strictly smaller than his height.

A seating is perfect if all children can see the board clearly. You will be given the heights of children from $$$1$$$ to $$$N$$$, can you check if their seating is perfect?

Input

The input consists of multiple test cases. The first line contains a single integer $$$T$$$ $$$(1 \le T \le 1000)$$$ — number of test cases.

The first line of each test case contains a single integer $$$N$$$ $$$(1 \le N \le 100)$$$ — Number of children.

The second line of each test case contains $$$N$$$ integers $$$H_1, H_2,..., H_N$$$ ($$$1 \le H_i \le 200$$$) — the heights of children.

Output

For each test case, print 'Yes' (without quotes) if the seating is perfect, otherwise print 'No' (without the quotes).

ExampleInput
2
3
1 6 7
4
8 4 6 12
Output
Yes
No

加入题单

上一题 下一题 算法标签: