def armstrong(i):
    t = i
    s = 0
    while t > 0:
        d = t % 10
        s = s + d * d * d
        t = t // 10
    if s == i:
        print('YES')
    else:
        print('NO')


number = int(input())
armstrong(number)

b2ff6973060a9d18c4ad7dd7a133e3f4c2f19bb2
<mask token>

def armstrong(i):
    t = i
    s = 0
    while t > 0:
        d = t % 10
        s = s + d * d * d
        t = t // 10
    if s == i:
        print('YES')
    else:
        print('NO')


<mask token>

def armstrong(i):
    t = i
    s = 0
    while t > 0:
        d = t % 10
        s = s + d * d * d
        t = t // 10
    if s == i:
        print('YES')
    else:
        print('NO')


<mask token>
armstrong(number)

def armstrong(i):
    t = i
    s = 0
    while t > 0:
        d = t % 10
        s = s + d * d * d
        t = t // 10
    if s == i:
        print('YES')
    else:
        print('NO')


number = int(input())
armstrong(number)
