#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 input = 0;
  scanf("%lld", &input);
  if ((input + 5) % 6 == 0)
    printf("yes");
  else if ((input + 3) % 6 == 0)
    printf("yes");
  else if (input % 6 == 0)
    printf("yes");
  else
    printf("no");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xec2(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rax
add    $0x5,%rax
mov    $0x6,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    1174 <main+0x54>
lea    0xe9b(%rip),%rdi
call   1030 <printf@plt>
jmp    11e0 <main+0xc0>
mov    -0x10(%rbp),%rax
add    $0x3,%rax
mov    $0x6,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    11a1 <main+0x81>
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xbb>
mov    -0x10(%rbp),%rax
mov    $0x6,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    11ca <main+0xaa>
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
jmp    11db <main+0xbb>
jmp    11e0 <main+0xc0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movq   $0x0,(%rsp)
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movabs $0xaaaaaaaaaaaaaaab,%rax
aa aa aa
imul   (%rsp),%rax
movabs $0x8000000000000001,%rdx
add    %rax,%rdx
ror    %rdx
lea    0xea7(%rip),%rdi
movabs $0x2aaaaaaaaaaaaaab,%rcx
aa aa 2a
cmp    %rcx,%rdx
jb     119e <main+0x7e>
lea    (%rax,%rcx,1),%rdx
ror    %rdx
cmp    %rcx,%rdx
jb     119e <main+0x7e>
movabs $0x2aaaaaaaaaaaaaaa,%rdx
aa aa 2a
add    %rdx,%rax
ror    %rax
cmp    %rcx,%rax
lea    0xe72(%rip),%rax
lea    0xe6f(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [4 x i8] c"yes\00"
@.str.2 = [3 x i8] c"no\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
store i64 0, i64* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = load i64, i64* %1
%5 = add nsw i64 %4, 5
%6 = srem i64 %5, 6
%7 = icmp eq i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %0
%9 = add nsw i64 %4, 3
%10 = srem i64 %9, 6
%11 = icmp eq i64 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = srem i64 %4, 6
%14 = icmp eq i64 %13, 0
%15 = select i1 %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
br label %16
16: ; preds = %12, %8, %0
%17 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %0 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %8 ], [ %15, %12 ]
%18 = call i32 @printf(i8* dereferenceable(1) %17)
ret i32 0
}