SP17918 SPCU - Gopu and Validity of Arrangement
Description
N persons are standing in a line. Height of each person is between 1 and N and height of each person is distinct.
You are given an array A where A\[i\] denotes how many persons are there before the i\_th person having heights greater than the height of the ith person. For a person i, all the persons from 1 to i - 1 are considered to be before him. eg, For person 2, person 1 is considered before him.
You have to find out whether this array can be valid for some arrangement of persons. If you can uniquely do so then output "YES" Otherwise output "NO".
Input Format
First line contains T : number of test cases. (1
Output Format
For each test case, output "YES" or "NO" according to answer.