You are given a non-negative integer *n*, its decimal representation consists of at most 100 digits and doesn't contain leading zeroes.

Your task is to determine if it is possible in this case to remove some of the digits (possibly not remove any digit at all) so that the result contains at least one digit, forms a non-negative integer, doesn't have leading zeroes and is divisible by 8. After the removing, it is forbidden to rearrange the digits.

If a solution exists, you should print it.
The single line of the input contains a non-negative integer *n*. The representation of number *n* doesn't contain any leading zeroes and its length doesn't exceed 100 digits.
def has_letters_in_order(string1, string2):
    

    # Initialize pointers for both strings
    ptr1, ptr2 = 0, 0

    # Iterate through the characters of string1
    while ptr1 < len(string1) and ptr2 < len(string2):
        # If the characters match, move both pointers
        if string1[ptr1] == string2[ptr2]:
            ptr1 += 1
        # Move only the pointer for string2
        ptr2 += 1

    # If ptr1 reached the end, it means all letters in string1 appear in order in string2
    return ptr1 == len(string1)



s=input()
l=['0', '8', '16', '24', '32', '40', '48', '56', '64', '72', '80', '88', '96', '104', '112', '120', '128', '136', '144', '152', '160', '168', '176', '184', '192', '200', '208', '216', '224', '232', '240', '248', '256', '264', '272', '280', '288', '296', '304', '312', '320', '328', '336', '344', '352', '360', '368', '376', '384', '392', '400', '408', '416', '424', '432', '440', '448', '456', '464', '472', '480', '488', '496', '504', '512', '520', '528', '536', '544', '552', '560', '568', '576', '584', '592', '600', '608', '616', '624', '632', '640', '648', '656', '664', '672', '680', '688', '696', '704', '712', '720', '728', '736', '744', '752', '760', '768', '776', '784', '792', '800', '808', '816', '824', '832', '840', '848', '856', '864', '872', '880', '888', '896', '904', '912', '920', '928', '936', '944', '952', '960', '968', '976', '984', '992', '1000']
for i in l:
    if len(i)<=len(s) and has_letters_in_order(i,s):
        print("YES")
        print(i)
        break
else:
    print("NO")


