def count_factor(n, p):
    count = 0
    while n % p == 0 and n != 0:
        count += 1
        n = n // p
    return count

S = input().strip()
s = int(S)

# Check modulo 2^12
mod_2_12 = 2 ** 12
s_mod2 = s % mod_2_12
possible2 = False

if s_mod2 == 0:
    possible2 = True
else:
    k = count_factor(s_mod2, 2)
    if k % 2 == 0:
        m = s_mod2 // (2 ** k)
        if m % 8 == 1 and k < 12:
            possible2 = True

# Check modulo 5^12
mod_5_12 = 5 ** 12
s_mod5 = s % mod_5_12
possible5 = False

if s_mod5 == 0:
    possible5 = True
else:
    k = count_factor(s_mod5, 5)
    if k % 2 == 0:
        if k <= 11:
            m = s_mod5 // (5 ** k)
            if m % 5 in {1, 4}:
                possible5 = True

if possible2 and possible5:
    print("YES")
else:
    print("NO")