#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*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ sqrt(int);
int main(void) {
  int n, i;
  scanf("%d", &n);
  if (n == 2)
    puts("yes");
  else if (n % 2 == 0)
    puts("no");
  else {
    for (i = ((int)sqrt(n)) | 1; i > 1 && n % i != 0; i -= 2)
      ;
    puts(i == 1 ? "yes" : "no");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x2,-0x8(%rbp)
jne    116a <main+0x3a>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
jmp    1201 <main+0xd1>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    118f <main+0x5f>
lea    0xe82(%rip),%rdi
call   1030 <puts@plt>
jmp    11fc <main+0xcc>
mov    -0x8(%rbp),%edi
call   1050 <sqrt@plt>
or     $0x1,%eax
mov    %eax,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x1,-0xc(%rbp)
mov    %al,-0xd(%rbp)
jle    11bc <main+0x8c>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    11cc <main+0x9c>
jmp    11df <main+0xaf>
jmp    11d1 <main+0xa1>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0xc(%rbp)
jmp    119d <main+0x6d>
mov    -0xc(%rbp),%ecx
lea    0xe1e(%rip),%rdi
lea    0xe13(%rip),%rax
cmp    $0x1,%ecx
cmove  %rax,%rdi
call   1030 <puts@plt>
jmp    1201 <main+0xd1>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%edi
cmp    $0x2,%edi
jne    1154 <main+0x24>
lea    0xeb1(%rip),%rdi
jmp    11ac <main+0x7c>
test   $0x1,%dil
jne    1163 <main+0x33>
lea    0xea6(%rip),%rdi
jmp    11ac <main+0x7c>
call   1050 <sqrt@plt>
mov    %rax,%rcx
or     $0x1,%ecx
cmp    $0x2,%ecx
jl     1195 <main+0x65>
mov    0x4(%rsp),%esi
nopw   0x0(%rax,%rax,1)
mov    %esi,%eax
cltd
idiv   %ecx
test   %edx,%edx
je     1195 <main+0x65>
lea    -0x2(%rcx),%eax
cmp    $0x3,%ecx
mov    %eax,%ecx
jg     1180 <main+0x50>
jmp    1197 <main+0x67>
mov    %ecx,%eax
cmp    $0x1,%eax
lea    0xe62(%rip),%rax
lea    0xe5f(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\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 i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %41
9: ; preds = %0
%10 = load i32, i32* %2
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %40
15: ; preds = %9
%16 = load i32, i32* %2
%17 = call i64 @sqrt(i32 %16)
%18 = trunc i64 %17 to i32
%19 = or i32 %18, 1
store i32 %19, i32* %3
br label %20
20: ; preds = %31, %15
%21 = load i32, i32* %3
%22 = icmp sgt i32 %21, 1
br i1 %22, label %23, label %28
23: ; preds = %20
%24 = load i32, i32* %2
%25 = load i32, i32* %3
%26 = srem i32 %24, %25
%27 = icmp ne i32 %26, 0
br label %28
28: ; preds = %23, %20
%29 = phi i1 [ false, %20 ], [ %27, %23 ]
br i1 %29, label %30, label %34
30: ; preds = %28
br label %31
31: ; preds = %30
%32 = load i32, i32* %3
%33 = sub nsw i32 %32, 2
store i32 %33, i32* %3
br label %20
34: ; preds = %28
%35 = load i32, i32* %3
%36 = icmp eq i32 %35, 1
%37 = zext i1 %36 to i64
%38 = select i1 %36, 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)
%39 = call i32 @puts(i8* %38)
br label %40
40: ; preds = %34, %13
br label %41
41: ; preds = %40, %7
ret i32 0
}

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