#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 *);
int main() {
  int num, i;
  scanf("%d", &num);
  for (i = 2; i < num; i++) {
    if (0 == num % i) {
      printf("NO");
      return 0;
    }
  }
  printf("YES");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    118e <main+0x6e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
xor    %eax,%eax
cmp    %edx,%eax
jne    117b <main+0x5b>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a1 <main+0x81>
jmp    1180 <main+0x60>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <main+0x26>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ecx
lea    0xec9(%rip),%rdi
cmp    $0x3,%ecx
jl     1165 <main+0x45>
mov    $0x2,%esi
lea    0xeb5(%rip),%r8
xchg   %ax,%ax
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1162 <main+0x42>
add    $0x1,%esi
cmp    %esi,%ecx
jne    1150 <main+0x30>
jmp    1165 <main+0x45>
mov    %r8,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"NO\00"
@.str.2 = [4 x i8] c"YES\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)
store i32 2, i32* %3
br label %5
5: ; preds = %17, %0
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = icmp slt i32 %6, %7
br i1 %8, label %9, label %20
9: ; preds = %5
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = srem i32 %10, %11
%13 = icmp eq i32 0, %12
br i1 %13, label %14, label %16
14: ; preds = %9
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %22
16: ; preds = %9
br label %17
17: ; preds = %16
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 1
store i32 %19, i32* %3
br label %5
20: ; preds = %5
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %1
br label %22
22: ; preds = %20, %14
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [3 x i8] c"NO\00"
@.str.2 = [4 x i8] c"YES\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 sgt i32 %4, 2
br i1 %5, label %8, label %13
6: ; preds = %8
%7 = icmp eq i32 %12, %4
br i1 %7, label %13, label %8
8: ; preds = %0, %6
%9 = phi i32 [ %12, %6 ], [ 2, %0 ]
%10 = srem i32 %4, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 1
br i1 %11, label %13, label %6
13: ; preds = %6, %8, %0
%14 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %0 ], [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %8 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %6 ]
%15 = call i32 @printf(i8* dereferenceable(1) %14)
ret i32 0
}