Korail is starting a pilot service that gives every KTX train on the Seoul to Busan line a grade. The grades are 1 through M, and a train with a smaller number has to reach the destination station earlier.
The track has one main line and two bypass tracks, as in the picture.

Trains reach the junction in the order they left the departure station. At the junction each train takes one of these two options.
For example, if the departure order is 1,3,2,4, send grade 1 down the main line, park grade 3 on a bypass track, let grade 2 pass, then release grade 3, and finally send grade 4 through. The trains enter the destination station in the order 1,2,3,4.
Given the departure order, write a program that decides whether the trains can enter the destination station in grade order, from 1 to M.
Input comes from standard input. The first line has the number of test cases T (1≤T≤20). Each test case is two lines. The first line has the number of trains M (1≤M≤100), and the second line has the grades N1,N2,…,NM in departure order, separated by single spaces. Every Ni is between 1 and M and they are all different, so each number from 1 to M appears exactly once.
Output goes to standard output. Print one line per test case: YES if the trains can arrive in grade order, NO otherwise.