from sys import stdin
n=int(stdin.readline())

def lucky():
    if n%4==0 or n%7==0 or n%44==0 or n%47==0 or n%74==0 or n%77==0 or n%444==0 or n%474==0 or n%477==0 or n%744==0 or n%747==0 or n%777==0:
        print ("YES")

    else:
        print ("No")
lucky()



a9fc0af02178cc37f4ec14abb867871c88a25b82
<mask token>

<mask token>


def lucky():
    if (n % 4 == 0 or n % 7 == 0 or n % 44 == 0 or n % 47 == 0 or n % 74 ==
        0 or n % 77 == 0 or n % 444 == 0 or n % 474 == 0 or n % 477 == 0 or
        n % 744 == 0 or n % 747 == 0 or n % 777 == 0):
        print('YES')
    else:
        print('No')


lucky()

<mask token>
n = int(stdin.readline())


def lucky():
    if (n % 4 == 0 or n % 7 == 0 or n % 44 == 0 or n % 47 == 0 or n % 74 ==
        0 or n % 77 == 0 or n % 444 == 0 or n % 474 == 0 or n % 477 == 0 or
        n % 744 == 0 or n % 747 == 0 or n % 777 == 0):
        print('YES')
    else:
        print('No')


lucky()

from sys import stdin
n = int(stdin.readline())


def lucky():
    if (n % 4 == 0 or n % 7 == 0 or n % 44 == 0 or n % 47 == 0 or n % 74 ==
        0 or n % 77 == 0 or n % 444 == 0 or n % 474 == 0 or n % 477 == 0 or
        n % 744 == 0 or n % 747 == 0 or n % 777 == 0):
        print('YES')
    else:
        print('No')


lucky()

from sys import stdin
n=int(stdin.readline())

def lucky():
    if n%4==0 or n%7==0 or n%44==0 or n%47==0 or n%74==0 or n%77==0 or n%444==0 or n%474==0 or n%477==0 or n%744==0 or n%747==0 or n%777==0:
        print ("YES")

    else:
        print ("No")
lucky()


