Let's call a sequence good if the sum of all its elements is $0$.
You have a sequence of integers $A_1, A_2, \ldots, A_N$. You may perform any number of operations on this sequence (including zero). In one operation, you should choose a valid index $i$ and decrease $A_i$ by $i$. Can you make the sequence good using these operations?

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first line of each test case contains a single integer $N$.
- The second line contains $N$ space-separated integers $A_1, A_2, \ldots, A_N$.

-----Output-----
For each test case, print a single line containing the string "YES" if it is possible to make the given sequence good or "NO" if it is impossible.

-----Constraints-----
- $1 \le T \le 1,000$
- $1 \le N \le 10$
- $|A_i| \le 100$ for each valid $i$

-----Subtasks-----
Subtask #1 (10 points): $N = 1$
Subtask #2 (30 points): $N \le 2$
Subtask #3 (60 points): original constraints

-----Example Input-----
2
1
-1
2
1 2

-----Example Output-----
NO
YES

-----Explanation-----
Example case 2: We can perform two operations ― subtract $1$ from $A_1$ and $2$ from $A_2$.

Difficulty: interview

Starter code:

Solutions:
n=int(input())
for i in range(n):
 t=int(input())
 m=list(map(int,input().split()))
 p,q=0,0
 if t==1:
  if m[0]>=0:
   print('YES')
  else:
   print('NO')
 else:
  for i in m:
   if i<0:
    q+=i
   else:
    p+=i
  if p>=abs(q):
   print('YES')
  else:
   print('NO')

n=int(input())
for i in range(n):
 t=int(input())
 m=list(map(int,input().split()))
 p,q=0,0
 if t==1:
  if m[0]>=0:
   print('YES')
  else:
   print('NO')
 else:
  for i in m:
   if i<0:
    q+=1
   else:
    p+=1
  if p>=abs(q):
   print('YES')
  else:
   print('NO')

for i in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 a,b=0,0
 if n==1:
  if l[0]>=0:
   print('YES')
  else:
   print('NO')
 else:
  for i in l:
   if i<0:
    b+=i
   else:
    a+=i
  if a>=abs(b):
   print('YES')
  else:
   print('NO')

# cook your dish here
for __ in range(int(input())):
 n=int(input())
 arr=list(map(int,input().split()))
 p_c,n_c=0,0
 if n==1:
  if arr[0]>=0:
   print("YES")
  else:
   print("NO")
 else:
  for i in arr:
   if i<0:
    n_c+=i
   else:
    p_c+=i
  
  if p_c>=abs(n_c):
   print("YES")
  else:
   print("NO")


# cook your dish here
t=int(input())
for i in range(t):
 n=int(input())
 l=list(map(int,input().split()))
 s=sum(l)
 if s>=0:
  print("YES")
 else:
  print("NO")


# cook your dish here
n = int(input())
for i in range(n):
 a = int(input())
 l = [int(x) for x in input().split()]
 if sum(l) >= 0:
  print("YES")
 else:
  print("NO")

for _ in range(int(input())):
 a=int(input())
 b=list(map(int,input().split()))
 k=sum(b)
 if k>=0:
  print("YES")
 else:
  print("NO")

# cook your dish here
# cook your dish here
for i in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 if(sum(a)>=0):
  print("YES")
 else:
  print("NO")

# cook your dish here
for i in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 if(sum(a)>=0):
  print("YES")
 else:
  print("NO")

t=int(input())
for i in range(t):
 n=int(input())
 a=list(map(int,input().split()))
 search=0
 for i in range(len(a)):
  if(a[i]<0):
   search=1
   break
 if(search==1):
  print("NO")
 else:
  print("YES")


# cook your dish here
for _ in range(int(input())):
 n = int(input())
 l = list(map(int,input().split()))
 if sum(l)>=0:
  print('YES')
 else:
  print('NO')


for _ in range(int(input())):
 n=int(input())
 a=list(map(int,input().split()))
 if(sum(a)>=0):
  print("YES")
 else:
  print("NO")

for _ in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 if(sum(l)>=0):
  print("YES")
 else:
  print("NO")


for _ in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 if(sum(l)>=0):
  print("YES")
 else:
  print("NO")

# cook your dish here
for _ in range(int(input())):
 n=int(input())
 l=list(map(int,input().split()))
 if(sum(l)>=0):
  print("YES")
 else:
  print("NO")

T = int(input())
for i in range(T):
 N = int(input())
 l = list(map(int, input().split()))
 if (sum(l) < 0):
  print("NO")
 else:
  print("YES")

T = int(input())
for i in range(0, T):
 n = int(input())
 arr = list(map(int, input().split()))
 flag=0
 if sum(arr)<0:
  flag=1
 if flag==1:
  print("NO")
 else:
  print("YES")




T = int(input())
for i in range(0, T):
 n = int(input())
 arr = list(map(int, input().split()))
 flag=0
 for x in arr:
  if x<0:
   flag=1
   break
 if flag==1:
  print("NO")
 else:
  print("YES")




for _ in range(int(input())):
 n=int(input())
 l=list(map(int,input().split(" ")))
 s=sum(l)
 if s>=0:
  print("YES")
 else:
  print("NO")

# ------- main function -------

def solve():
 n = int(input())
 a = list(map(int,input().split(' ')))
 ls = sum(a)
 if ls >= 0:
  print("YES")
 else:
  print("NO")



# ------- starting point of program -------

def __starting_point():
 for _ in range(int(input())):
  solve()

__starting_point()

for _ in range(int(input())):
 n= int(input())
 arr = list(map(int,input().split()))
 if sum(arr)<0:
  print("NO")
 else:
  print("YES")


# cook your dish here
t = int(input())
for x in range(t):
 n=int(input())
 l = [int(i) for i in input().split()]
 s = sum(l)
 if(s>=0):
  print("YES")
 else:
  print("NO")

# cook your dish here
t = int(input())
for x in range(t):
 n=int(input())
 l = [int(i) for i in input().split()]
 for i in l:
  if(i<0):
   print("NO")
   break
 else:
  print("YES")

# cook your dish here
t = int (input())
while t > 0:
 n = int(input())
 l = list(map(int,input().strip().split()))[:n]
 s = sum(l)
 if s >= 0:
  print("YES")
 else :
  print("NO")
 t = t - 1


# cook your dish here
t=int(input())
while t>0:
 n=int(input())
 l=list(map(int,input().split()))
 s=sum(l)
 if s>=0:
  print("YES")
 else:
  print("NO")
 t=t-1