x=int(raw_input())
out=[]
while x>0 :
l=[]
first=[]
flag=0
half=[]
y=int(raw_input())
l=raw_input().split()
l=list(map(int, l))
for i in range(y/2):
first.append(l[i])
if(l[i]==(l[i+1]-1) or l[i+1]==l[i]):
flag=1
#print flag
else:
flag=0
#print flag
for i in range(y-1,y/2, -1):
half.append(l[i])
#print half
#print first
#print flag
for i in range(len(half)):
if(flag==1 and half[i]==first[i]):
flag=1
else:
flag=0
x-=1
if(flag==1):
out.append("yes")
else:
out.append("no")
for i in out:
print i