Chef likes all arrays equally. But he likes some arrays more equally than others. In particular, he loves Rainbow Arrays. 
An array is Rainbow if it has the following structure:
- First a1 elements equal 1. 
- Next a2 elements equal 2. 
- Next a3 elements equal 3. 
- Next a4 elements equal 4. 
- Next a5 elements equal 5. 
- Next a6 elements equal 6. 
- Next a7 elements equal 7. 
- Next a6 elements equal 6. 
- Next a5 elements equal 5. 
- Next a4 elements equal 4. 
- Next a3 elements equal 3. 
- Next a2 elements equal 2. 
- Next a1 elements equal 1. 
- ai can be any non-zero positive integer.
- There are no other elements in array. 

Help Chef in finding out if the given array is a Rainbow Array or not. 

-----Input-----
- The first line of the input contains an integer T denoting the number of test cases.
- The first line of each test case contains an integer N, denoting the number of elements in the given array. 
- The second line contains N space-separated integers A1, A2, ..., AN denoting the elements of array. 

-----Output-----
- For each test case, output a line containing "yes" or "no" (without quotes) corresponding to the case if the array is rainbow array or not. 

-----Constraints-----
- 1 ≤ T ≤ 100
- 7 ≤ N ≤ 100
- 1 ≤ Ai ≤ 10

-----Subtasks-----
- Subtask 1 (100 points) : Original constraints

-----Example-----
Input
3
19
1 2 3 4 4 5 6 6 6 7 6 6 6 5 4 4 3 2 1
14
1 2 3 4 5 6 7 6 5 4 3 2 1 1
13
1 2 3 4 5 6 8 6 5 4 3 2 1

Output
yes
no
no

-----Explanation-----
The first example satisfies all the conditions. 
The second example has 1 element of value 1 at the beginning and 2 elements of value 1 at the end. 
The third one has no elements with value 7 after elements with value 6.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "# cook your dish here\nt = int(input())\nb=[1,2,3,4,5,6,7]\nfor i in range(t):\n n = int(input())\n a=list(map(int,input().split())) \n sevenInt=[]\n revList=a[::-1]\n for j in a:\n  if j not in sevenInt:\n   sevenInt.append(j)\n if(sevenInt==b and a==revList):\n  print('yes')\n else:\n  print('no')\n \n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13101