#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 *, ...);
void test_case() {
  int kids;
  scanf("%d", &kids);
  long long sum = 0;
  for (int i = 0; i < kids; i++) {
    long long temp;
    scanf("%lld", &temp);
    sum += temp;
    if (sum > kids)
      sum %= kids;
  }
  printf(sum == 0 || sum == kids ? "YES\n" : "NO\n");
}


x86 assembly (clang, -O0):
<test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a8 <test_case+0x88>
lea    0xea7(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x20(%rbp),%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
jle    1195 <test_case+0x75>
movslq -0x4(%rbp),%rcx
mov    -0x10(%rbp),%rax
cqto
idiv   %rcx
mov    %rdx,-0x10(%rbp)
jmp    119a <test_case+0x7a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <test_case+0x29>
mov    $0x1,%al
cmpq   $0x0,-0x10(%rbp)
mov    %al,-0x21(%rbp)
je     11c9 <test_case+0xa9>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
cmp    %rcx,%rax
sete   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%cl
lea    0xe3a(%rip),%rdi
lea    0xe2e(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
jle    11a6 <test_case+0x86>
lea    0xeb7(%rip),%r14
lea    0x10(%rsp),%r15
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    1172 <test_case+0x52>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rax
cqto
idiv   %rsi
mov    %rdx,%rbx
add    $0x1,%ebp
cmp    %ecx,%ebp
jge    11a8 <test_case+0x88>
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
add    0x10(%rsp),%rbx
mov    0xc(%rsp),%ecx
movslq %ecx,%rsi
cmp    %rsi,%rbx
jle    116b <test_case+0x4b>
mov    %rbx,%rax
or     %rsi,%rax
shr    $0x20,%rax
jne    1160 <test_case+0x40>
mov    %ebx,%eax
xor    %edx,%edx
div    %ecx
mov    %edx,%ebx
jmp    116b <test_case+0x4b>
xor    %ebx,%ebx
movslq %ecx,%rax
cmp    %rax,%rbx
lea    0xe53(%rip),%rax
lea    0xe51(%rip),%rdi
cmove  %rax,%rdi
test   %rbx,%rbx
cmove  %rax,%rdi
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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