A chicken farm ships boxes of eggs to the market. The boxes have different heights, so the loading order matters. The boxes are loaded standing up, sorted from the shortest box to the tallest box.

The farm has one hydraulic arm, and the arm performs exactly one of these three actions at a time.
The shelf is loaded and unloaded only at its leftmost position, so the box placed on the shelf last is the first one to leave it. To keep the line fast, the arm never touches a box that already sits on the right belt.
The boxes on the left belt reach the arm in the order a1,a2,…,aN. The arm picks up a1 first and aN last. Each moved box goes to the leftmost position of the right belt, so a box placed earlier stays further to the right. The goal is to move every box to the right belt and end with the tallest box at the far left and the shortest box at the far right. That means the boxes must be placed on the right belt in increasing order of height.
Given the order in which the boxes reach the arm, write a program that decides whether the goal is reachable.
The first line contains the number of test cases T (1≤T≤20).
The first line of each test case contains the number of boxes N (1≤N≤10000). The second line contains the heights a1,a2,…,aN (1≤ai≤N) in the order the arm picks the boxes up. No two boxes have the same height.
For each test case, print the answer on its own line. Print yes if some sequence of actions reaches the goal, and no if none does. Print both words in lowercase.