#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 *, long long *);
int main() {
  long long int t, t2, j, x, y;
  scanf("%lld", &t);
  while (t--) {
    x = 0;
    scanf("%lld", &t2);
    for (j = 0; j < t2; j++) {
      scanf("%lld", &y);
      x = (x + y) % t2;
    }
    if (x == 0)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     11e6 <main+0xc6>
movq   $0x0,-0x28(%rbp)
lea    0xe99(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    11b9 <main+0x99>
lea    0xe73(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rax
add    -0x30(%rbp),%rax
cqto
idivq  -0x18(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1178 <main+0x58>
cmpq   $0x0,-0x28(%rbp)
jne    11d5 <main+0xb5>
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xc1>
lea    0xe2e(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0x1f>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xecb(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
subq   $0x1,0x8(%rsp)
jae    1158 <main+0x38>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea1(%rip),%r12
mov    %rsp,%r14
lea    0xe9f(%rip),%r13
lea    0x10(%rsp),%r15
jmp    118b <main+0x6b>
test   %rbx,%rbx
lea    0xe8b(%rip),%rdi
cmove  %r13,%rdi
call   1030 <puts@plt>
subq   $0x1,0x8(%rsp)
jb     1147 <main+0x27>
mov    %r12,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
cmpq   $0x0,(%rsp)
mov    %r13,%rdi
jle    117e <main+0x5e>
xor    %ebx,%ebx
xor    %ebp,%ebp
jmp    11c4 <main+0xa4>
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rax
cqto
idiv   %rcx
mov    %rdx,%rbx
add    $0x1,%rbp
cmp    %rcx,%rbp
jge    1170 <main+0x50>
mov    %r12,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
add    0x10(%rsp),%rbx
mov    (%rsp),%rcx
mov    %rbx,%rax
or     %rcx,%rax
shr    $0x20,%rax
jne    11b0 <main+0x90>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%ebx
jmp    11bb <main+0x9b>

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [5 x i8] c"YES\0A\00"
@.str.2 = [4 x i8] c"NO\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
br label %8
8: ; preds = %35, %0
%9 = load i64, i64* %2
%10 = add nsw i64 %9, -1
store i64 %10, i64* %2
%11 = icmp ne i64 %9, 0
br i1 %11, label %12, label %36
12: ; preds = %8
store i64 0, i64* %5
%13 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
store i64 0, i64* %4
br label %14
14: ; preds = %25, %12
%15 = load i64, i64* %4
%16 = load i64, i64* %3
%17 = icmp slt i64 %15, %16
br i1 %17, label %18, label %28
18: ; preds = %14
%19 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %6)
%20 = load i64, i64* %5
%21 = load i64, i64* %6
%22 = add nsw i64 %20, %21
%23 = load i64, i64* %3
%24 = srem i64 %22, %23
store i64 %24, i64* %5
br label %25
25: ; preds = %18
%26 = load i64, i64* %4
%27 = add nsw i64 %26, 1
store i64 %27, i64* %4
br label %14
28: ; preds = %14
%29 = load i64, i64* %5
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %35
33: ; preds = %28
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %35
35: ; preds = %33, %31
br label %8
36: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@str = [3 x i8] c"NO\00"
@str.3 = [4 x i8] c"YES\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = bitcast i64* %1 to i8*
%5 = bitcast i64* %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%8 = load i64, i64* %1
%9 = add nsw i64 %8, -1
store i64 %9, i64* %1
%10 = icmp eq i64 %8, 0
br i1 %10, label %34, label %11
11: ; preds = %0, %28
%12 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%13 = load i64, i64* %2
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %11, %15
%16 = phi i64 [ %22, %15 ], [ 0, %11 ]
%17 = phi i64 [ %23, %15 ], [ 0, %11 ]
%18 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %3)
%19 = load i64, i64* %3
%20 = add nsw i64 %19, %16
%21 = load i64, i64* %2
%22 = srem i64 %20, %21
%23 = add nuw nsw i64 %17, 1
%24 = icmp slt i64 %23, %21
br i1 %24, label %15, label %25
25: ; preds = %15
%26 = icmp eq i64 %22, 0
%27 = select i1 %26, 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, i64 0, i64 0)
br label %28
28: ; preds = %25, %11
%29 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @str.3, i64 0, i64 0), %11 ], [ %27, %25 ]
%30 = call i32 @puts(i8* dereferenceable(1) %29)
%31 = load i64, i64* %1
%32 = add nsw i64 %31, -1
store i64 %32, i64* %1
%33 = icmp eq i64 %31, 0
br i1 %33, label %34, label %11
34: ; preds = %28, %0
ret i32 0
}