#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  long long int t, n, r, s, i;
  scanf("%lld", &t);
  while (t--) {
    s = 0;
    r = 0;
    int p = 0;
    scanf("%lld", &n);
    int a[n];
    for (i = 0; i < n; i++) {
      scanf("%lld", &a[i]);
      s = s + a[i];
      if (a[i] > 0)
        r++;
      if (a[i] > 100)
        p = 1;
    }
    if (p == 1) {
      printf("NO\n");
      continue;
    }
    if (s < 100) {
      printf("NO\n");
    } else if (s < 100 + r)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     12db <main+0x1bb>
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xe88(%rip),%rdi
xor    %eax,%eax
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x40(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    123e <main+0x11e>
mov    -0x58(%rbp),%rsi
mov    -0x30(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe29(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x58(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%rdx
movslq (%rax,%rdx,4),%rdx
add    %rdx,%rcx
mov    %rcx,-0x28(%rbp)
mov    -0x30(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jle    120f <main+0xef>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
mov    -0x58(%rbp),%rax
mov    -0x30(%rbp),%rcx
cmpl   $0x64,(%rax,%rcx,4)
jle    1228 <main+0x108>
movl   $0x1,-0x34(%rbp)
jmp    122d <main+0x10d>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    11b3 <main+0x93>
cmpl   $0x1,-0x34(%rbp)
jne    1260 <main+0x140>
lea    0xdb6(%rip),%rdi
call   1030 <printf@plt>
movl   $0x2,-0x4c(%rbp)
jmp    12ba <main+0x19a>
cmpq   $0x64,-0x28(%rbp)
jge    127c <main+0x15c>
lea    0xd93(%rip),%rdi
call   1030 <printf@plt>
jmp    12b3 <main+0x193>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    $0x64,%rcx
cmp    %rcx,%rax
jge    12a2 <main+0x182>
lea    0xd71(%rip),%rdi
call   1030 <printf@plt>
jmp    12ae <main+0x18e>
lea    0xd5c(%rip),%rdi
call   1030 <printf@plt>
jmp    12b3 <main+0x193>
movl   $0x0,-0x4c(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,%rsp
mov    -0x4c(%rbp),%eax
test   %eax,%eax
je     12d6 <main+0x1b6>
jmp    12d1 <main+0x1b1>
jmp    1141 <main+0x21>
jmp    1141 <main+0x21>
xor    %eax,%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xec8(%rip),%rdi
lea    -0x38(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
subq   $0x1,-0x38(%rbp)
jae    115b <main+0x3b>
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9e(%rip),%r14
lea    0xea0(%rip),%r15
jmp    117f <main+0x5f>
nopl   0x0(%rax,%rax,1)
call   1030 <puts@plt>
mov    %rbx,%rsp
subq   $0x1,-0x38(%rbp)
jb     114a <main+0x2a>
mov    %r14,%rdi
lea    -0x30(%rbp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rsp,%rbx
mov    -0x30(%rbp),%rax
mov    %rsp,%rdx
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,%rsp
cmpq   $0x0,-0x30(%rbp)
mov    %r15,%rdi
jle    1170 <main+0x50>
mov    %rbx,-0x40(%rbp)
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %ebx,%ebx
xor    %r15d,%r15d
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rsi,-0x48(%rbp)
lea    (%rdx,%r12,1),%rsi
lea    0xe21(%rip),%rdi
xor    %eax,%eax
mov    %rdx,%r14
call   1040 <scanf@plt>
mov    -0x48(%rbp),%rsi
mov    %r14,%rdx
movslq (%r14,%r15,4),%rax
xor    %ecx,%ecx
test   %rax,%rax
setg   %cl
add    %rax,%rsi
add    %rcx,%r13
cmp    $0x65,%rax
mov    $0x1,%eax
cmovge %eax,%ebx
add    $0x1,%r15
add    $0x4,%r12
cmp    -0x30(%rbp),%r15
jl     11d0 <main+0xb0>
lea    0xde6(%rip),%r15
mov    %r15,%rdi
cmp    $0x1,%ebx
lea    0xdd0(%rip),%r14
mov    -0x40(%rbp),%rbx
je     1170 <main+0x50>
mov    %r15,%rdi
cmp    $0x64,%rsi
jl     1170 <main+0x50>
add    $0x64,%r13
cmp    %r13,%rsi
mov    %r15,%rdi
lea    0xdad(%rip),%rax
cmovl  %rax,%rdi
jmp    1170 <main+0x50>

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"NO\0A\00"
@.str.2 = [5 x i8] c"YES\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
br label %12
12: ; preds = %76, %73, %0
%13 = load i64, i64* %2
%14 = add nsw i64 %13, -1
store i64 %14, i64* %2
%15 = icmp ne i64 %13, 0
br i1 %15, label %16, label %77
16: ; preds = %12
store i64 0, i64* %5
store i64 0, i64* %4
store i32 0, i32* %7
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%18 = load i64, i64* %3
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %8
%20 = alloca i32, i64 %18
store i64 %18, i64* %9
store i64 0, i64* %6
br label %21
21: ; preds = %49, %16
%22 = load i64, i64* %6
%23 = load i64, i64* %3
%24 = icmp slt i64 %22, %23
br i1 %24, label %25, label %52
25: ; preds = %21
%26 = load i64, i64* %6
%27 = getelementptr inbounds i32, i32* %20, i64 %26
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %27)
%29 = load i64, i64* %5
%30 = load i64, i64* %6
%31 = getelementptr inbounds i32, i32* %20, i64 %30
%32 = load i32, i32* %31
%33 = sext i32 %32 to i64
%34 = add nsw i64 %29, %33
store i64 %34, i64* %5
%35 = load i64, i64* %6
%36 = getelementptr inbounds i32, i32* %20, i64 %35
%37 = load i32, i32* %36
%38 = icmp sgt i32 %37, 0
br i1 %38, label %39, label %42
39: ; preds = %25
%40 = load i64, i64* %4
%41 = add nsw i64 %40, 1
store i64 %41, i64* %4
br label %42
42: ; preds = %39, %25
%43 = load i64, i64* %6
%44 = getelementptr inbounds i32, i32* %20, i64 %43
%45 = load i32, i32* %44
%46 = icmp sgt i32 %45, 100
br i1 %46, label %47, label %48
47: ; preds = %42
store i32 1, i32* %7
br label %48
48: ; preds = %47, %42
br label %49
49: ; preds = %48
%50 = load i64, i64* %6
%51 = add nsw i64 %50, 1
store i64 %51, i64* %6
br label %21
52: ; preds = %21
%53 = load i32, i32* %7
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
store i32 2, i32* %10
br label %73
57: ; preds = %52
%58 = load i64, i64* %5
%59 = icmp slt i64 %58, 100
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %72
62: ; preds = %57
%63 = load i64, i64* %5
%64 = load i64, i64* %4
%65 = add nsw i64 100, %64
%66 = icmp slt i64 %63, %65
br i1 %66, label %67, label %69
67: ; preds = %62
%68 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %71
69: ; preds = %62
%70 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %71
71: ; preds = %69, %67
br label %72
72: ; preds = %71, %60
store i32 0, i32* %10
br label %73
73: ; preds = %72, %55
%74 = load i8*, i8** %8
%75 = load i32, i32* %10
switch i32 %75, label %78 [
i32 0, label %76
i32 2, label %12
]
76: ; preds = %73
br label %12
77: ; preds = %12
ret i32 0
78: ; preds = %73
unreachable
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@str.3 = [4 x i8] c"YES\00"
@str.5 = [3 x i8] c"NO\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%6 = load i64, i64* %1
%7 = add nsw i64 %6, -1
store i64 %7, i64* %1
%8 = icmp eq i64 %6, 0
br i1 %8, label %48, label %9
9: ; preds = %0, %42
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%11 = load i64, i64* %2
%12 = call i8* @llvm.stacksave()
%13 = alloca i32, i64 %11
%14 = load i64, i64* %2
%15 = icmp sgt i64 %14, 0
br i1 %15, label %16, label %42
16: ; preds = %9, %16
%17 = phi i64 [ %28, %16 ], [ 0, %9 ]
%18 = phi i32 [ %30, %16 ], [ 0, %9 ]
%19 = phi i64 [ %31, %16 ], [ 0, %9 ]
%20 = phi i64 [ %25, %16 ], [ 0, %9 ]
%21 = getelementptr inbounds i32, i32* %13, i64 %19
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %21)
%23 = load i32, i32* %21
%24 = sext i32 %23 to i64
%25 = add nsw i64 %20, %24
%26 = icmp sgt i32 %23, 0
%27 = zext i1 %26 to i64
%28 = add nuw nsw i64 %17, %27
%29 = icmp sgt i32 %23, 100
%30 = select i1 %29, i32 1, i32 %18
%31 = add nuw nsw i64 %19, 1
%32 = load i64, i64* %2
%33 = icmp slt i64 %31, %32
br i1 %33, label %16, label %34
34: ; preds = %16
%35 = icmp eq i32 %30, 1
br i1 %35, label %42, label %36
36: ; preds = %34
%37 = icmp slt i64 %25, 100
br i1 %37, label %42, label %38
38: ; preds = %36
%39 = add nuw nsw i64 %28, 100
%40 = icmp slt i64 %25, %39
%41 = select i1 %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0)
br label %42
42: ; preds = %38, %36, %9, %34
%43 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0), %34 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0), %9 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @str.5, i64 0, i64 0), %36 ], [ %41, %38 ]
%44 = call i32 @puts(i8* dereferenceable(1) %43)
%45 = load i64, i64* %1
%46 = add nsw i64 %45, -1
store i64 %46, i64* %1
%47 = icmp eq i64 %45, 0
br i1 %47, label %48, label %9
48: ; preds = %42, %0
ret i32 0
}