SP18240 KURUK14 - GENIE SEQUENCE
Description
A Genie Sequence is a sequence in which every element indicates the number of elements present before or after it. Given an array of numbers, find whether you can form a Genie sequence or not.
Input Format
First line contains a single integer T, the number of test cases. It is followed by T cases each of which contains two lines. First line of each test case contains a single integer N. The next line contains N integers separated by a single space.
Output Format
For each test case output a single line containing "`YES`" (without quotes) if it is possible to form a genie sequence or "`NO`" (without quotes) if it is not possible.