
num = int(input())

if num % 47 == 0 or num % 74 == 0 or num % 744 == 0 or num % 474 == 0 or num % 4 == 0 or num % 7 == 0 or num % 77 == 0 or num % 44 == 0 or num % 444 == 0 or num % 777 == 0 or num % 447 == 0 or num % 477 == 0 or num % 747 == 0 or num % 774 == 0:
    print("YES")    

else:
    print("NO")
