Your are given N students with some goodies to be distrubuted among them such that student at ith index gets exactly i amount of goodies (considering no wastage). The goodies has already been distributed by some other. Your task is to check if it can be redistributed such that student at ith index gets i amount of goodies.
First line of input denotes the number of test cases T. The first line of each test case contains one integer N, denoting the number of students. The second line of each test case contains N integers each Ai, denoting the number of goodies distributed to ith member.
Print "YES" if we can redistribute in the requried way, otherwise "NO" (without quotes).
1 <= T <= 100
1 <= N <= 107
1 <= Ai <= 1018
7 4 1 1 2
1 1 1 1 1
Testcase 1: Since, all the goods can be redistributed as 1 2 3 4 5 (ith students get i number of goodies). So, output is YES.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.