#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;
  scanf("%d", &num);
  if (num % 4 == 0 || num % 7 == 0 || num % 74 == 0 || num % 47 == 0 ||
      num % 474 == 0 || num % 447 == 0 || num % 477 == 0)
    printf("YES");
  else if (num == 774 || num == 744 || num == 747)
    printf("YES");
  else
    printf("NO");
  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>
mov    -0x8(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <main+0xab>
mov    -0x8(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <main+0xab>
mov    -0x8(%rbp),%eax
mov    $0x4a,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <main+0xab>
mov    -0x8(%rbp),%eax
mov    $0x2f,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <main+0xab>
mov    -0x8(%rbp),%eax
mov    $0x1da,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <main+0xab>
mov    -0x8(%rbp),%eax
mov    $0x1bf,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11cb <main+0xab>
mov    -0x8(%rbp),%eax
mov    $0x1dd,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11dc <main+0xbc>
lea    0xe31(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
cmpl   $0x306,-0x8(%rbp)
je     1203 <main+0xe3>
cmpl   $0x2e8,-0x8(%rbp)
je     1203 <main+0xe3>
cmpl   $0x2eb,-0x8(%rbp)
jne    1214 <main+0xf4>
lea    0xdf9(%rip),%rdi
call   1030 <printf@plt>
jmp    1220 <main+0x100>
lea    0xdec(%rip),%rdi
call   1030 <printf@plt>
jmp    1225 <main+0x105>
xor    %eax,%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>
movslq 0x4(%rsp),%rax
lea    0xec5(%rip),%rdi
test   $0x3,%al
je     1237 <main+0x117>
imul   $0xffffffff92492493,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
lea    0x0(,%rcx,8),%edx
sub    %edx,%ecx
add    %eax,%ecx
je     1237 <main+0x117>
imul   $0xffffffffdd67c8a7,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x6,%ecx
add    %edx,%ecx
imul   $0x4a,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
je     1237 <main+0x117>
imul   $0xffffffffae4c415d,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x5,%ecx
add    %edx,%ecx
imul   $0x2f,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
je     1237 <main+0x117>
imul   $0xffffffff8a42f871,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x8,%ecx
add    %edx,%ecx
imul   $0x1da,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
je     1237 <main+0x117>
imul   $0xffffffff929cebf5,%rax,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x8,%ecx
add    %edx,%ecx
imul   $0x1bf,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
je     1237 <main+0x117>
imul   $0x89645c5,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x1dd,%ecx,%ecx
mov    %eax,%edx
sub    %ecx,%edx
je     1237 <main+0x117>
add    $0xfffffd18,%eax
cmp    $0x1e,%eax
ja     1230 <main+0x110>
mov    $0x40000009,%ecx
bt     %eax,%ecx
jb     1237 <main+0x117>
lea    0xdd0(%rip),%rdi
call   1030 <printf@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
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = srem i32 %4, 4
%6 = icmp eq i32 %5, 0
br i1 %6, label %31, label %7
7: ; preds = %0
%8 = load i32, i32* %2
%9 = srem i32 %8, 7
%10 = icmp eq i32 %9, 0
br i1 %10, label %31, label %11
11: ; preds = %7
%12 = load i32, i32* %2
%13 = srem i32 %12, 74
%14 = icmp eq i32 %13, 0
br i1 %14, label %31, label %15
15: ; preds = %11
%16 = load i32, i32* %2
%17 = srem i32 %16, 47
%18 = icmp eq i32 %17, 0
br i1 %18, label %31, label %19
19: ; preds = %15
%20 = load i32, i32* %2
%21 = srem i32 %20, 474
%22 = icmp eq i32 %21, 0
br i1 %22, label %31, label %23
23: ; preds = %19
%24 = load i32, i32* %2
%25 = srem i32 %24, 447
%26 = icmp eq i32 %25, 0
br i1 %26, label %31, label %27
27: ; preds = %23
%28 = load i32, i32* %2
%29 = srem i32 %28, 477
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27, %23, %19, %15, %11, %7, %0
%32 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %47
33: ; preds = %27
%34 = load i32, i32* %2
%35 = icmp eq i32 %34, 774
br i1 %35, label %42, label %36
36: ; preds = %33
%37 = load i32, i32* %2
%38 = icmp eq i32 %37, 744
br i1 %38, label %42, label %39
39: ; preds = %36
%40 = load i32, i32* %2
%41 = icmp eq i32 %40, 747
br i1 %41, label %42, label %44
42: ; preds = %39, %36, %33
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %46
44: ; preds = %39
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
br label %47
47: ; preds = %46, %31
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 = and i32 %4, 3
%6 = icmp eq i32 %5, 0
%7 = srem i32 %4, 7
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
%10 = srem i32 %4, 74
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 true, i1 %11
%13 = srem i32 %4, 47
%14 = icmp eq i32 %13, 0
%15 = select i1 %12, i1 true, i1 %14
%16 = srem i32 %4, 474
%17 = icmp eq i32 %16, 0
%18 = select i1 %15, i1 true, i1 %17
%19 = srem i32 %4, 447
%20 = icmp eq i32 %19, 0
%21 = select i1 %18, i1 true, i1 %20
%22 = srem i32 %4, 477
%23 = icmp eq i32 %22, 0
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %27, label %25
25: ; preds = %0
switch i32 %4, label %26 [
i32 774, label %27
i32 747, label %27
i32 744, label %27
]
26: ; preds = %25
br label %27
27: ; preds = %25, %25, %25, %0, %26
%28 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), %26 ], [ 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), %25 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %25 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), %25 ]
%29 = call i32 @printf(i8* dereferenceable(1) %28)
ret i32 0
}