n = int(input())

if n%8 == 0 or n%8 == 7:
    print('Yes')
else:
    print('No')