#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
typedef vector<int> vi;
int main(){
int t;
cin>>t;
for(int testcase=0; testcase<t; testcase++){
int n; cin>>n;
uint64_t sum = n*(n+1);
sum = sum/2;
vi pre(n+1);
bool f = true;
for (int i = 1; i <= n-1; i++)
{
// int tttt;
cin>>pre[i];
if(pre[i]>sum) f=false;
}
// cout<<"working "<<i;
// pre.push_back(0);
//--------------------------------------------
vi res(2*n + 1);
if(pre[n-1]!=sum){
pre[n] = sum;
vi chkvec(n+1,0);
++chkvec[pre[1]];
for (int i = 1; i <=n; i++)
{
++chkvec[pre[i] - pre[i-1]];
// chkvec.push_back(pre[i] - pre[i-1]);
// if(chkvec[tt]>2) {f=false; break;}
}
for(int p = 1; p<=n; p++){
if(chkvec[p]!=1) f = false;
}
// cout<<chkvec.size();
}
else{
// cout<<"else me hu";
for (int i = 1; i <= n-1; i++)
{
int tt = pre[i] - pre[i-1];
++res[tt];
if(res[tt]>1) {f=false; break;}
}
}
if(f) cout<<"YES"<<endl;
else cout<<"NO"<<endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+IAogCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiAKI2RlZmluZSBlbmRsICJcbiIgCnR5cGVkZWYgbG9uZyBsb25nIGludCBsbDsKdHlwZWRlZiB2ZWN0b3I8aW50PiB2aTsKCmludCBtYWluKCl7CiAgICBpbnQgdDsKICAgIGNpbj4+dDsKICAgIAogICAgZm9yKGludCB0ZXN0Y2FzZT0wOyB0ZXN0Y2FzZTx0OyB0ZXN0Y2FzZSsrKXsKICAgICAgICBpbnQgbjsgY2luPj5uOwoKICAgICAgICB1aW50NjRfdCBzdW0gPSBuKihuKzEpOwogICAgICAgIHN1bSA9IHN1bS8yOwoKICAgICAgICB2aSBwcmUobisxKTsKCiAgICAgICAgYm9vbCBmICA9IHRydWU7CiAgICAgICAgZm9yIChpbnQgIGkgPSAxOyBpIDw9IG4tMTsgaSsrKQogICAgICAgIHsKICAgICAgICAgICAgLy8gaW50IHR0dHQ7CiAgICAgICAgICAgIGNpbj4+cHJlW2ldOwogICAgICAgICAgICBpZihwcmVbaV0+c3VtKSBmPWZhbHNlOwogICAgICAgIH0KICAgICAgICAvLyBjb3V0PDwid29ya2luZyAiPDxpOwoKICAgICAgICAvLyBwcmUucHVzaF9iYWNrKDApOwogICAgICAgIAogICAgICAgIC8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KCiAgICAgICAgdmkgcmVzKDIqbiArIDEpOwoKICAgICAgICBpZihwcmVbbi0xXSE9c3VtKXsKICAgICAgICAgICAgcHJlW25dID0gc3VtOwoKICAgICAgICAgICAgdmkgY2hrdmVjKG4rMSwwKTsKICAgICAgICAgICAgKytjaGt2ZWNbcHJlWzFdXTsKICAgICAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPD1uOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgICsrY2hrdmVjW3ByZVtpXSAtIHByZVtpLTFdXTsKICAgICAgICAgICAgICAgIC8vIGNoa3ZlYy5wdXNoX2JhY2socHJlW2ldIC0gcHJlW2ktMV0pOwogICAgICAgICAgICAgICAgLy8gaWYoY2hrdmVjW3R0XT4yKSB7Zj1mYWxzZTsgYnJlYWs7fQogICAgICAgICAgICB9CgogICAgICAgICAgICBmb3IoaW50IHAgPSAxOyBwPD1uOyBwKyspewogICAgICAgICAgICAgICAgaWYoY2hrdmVjW3BdIT0xKSBmID0gZmFsc2U7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgLy8gY291dDw8Y2hrdmVjLnNpemUoKTsKICAgICAgICB9CgogICAgICAgIGVsc2V7CiAgICAgICAgICAgIC8vIGNvdXQ8PCJlbHNlIG1lIGh1IjsKICAgICAgICAgICAgZm9yIChpbnQgaSA9IDE7IGkgPD0gbi0xOyBpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGludCB0dCA9IHByZVtpXSAtIHByZVtpLTFdOwoKICAgICAgICAgICAgICAgICsrcmVzW3R0XTsKICAgICAgICAgICAgICAgIGlmKHJlc1t0dF0+MSkge2Y9ZmFsc2U7IGJyZWFrO30KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICAKICAgICAgICBpZihmKSBjb3V0PDwiWUVTIjw8ZW5kbDsKICAgICAgICBlbHNlIGNvdXQ8PCJOTyI8PGVuZGw7CiAgICB9CgogICAgcmV0dXJuIDA7Cn0=