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.
import math
import string
import sys

# sys.setrecursionlimit(2**30)
# sys.stdin = open(".in", "r")
# sys.stdout = open(".out", "w")
input = sys.stdin.readline


def print(*args, end='\n', sep=' ') -> None:
    sys.stdout.write(sep.join(map(str, args)) + end)


def map_int():
    return map(int, input().split())


def list_int():
    return list(map(int, input().split()))


def matrixPrint(matrix):
    for x in matrix:
        print(*x)


from collections import defaultdict, deque, Counter
from math import sqrt, gcd, comb, perm, factorial, log, floor
from itertools import permutations

from math import ceil
# from random import shuffle
from heapq import heappop, heappush, heapify
from math import lcm
def possible(n):
    # print(n)
    if (not n or (n!='0' and n[0] == '0' )):
        return (-1, -1)
    if (int(n)%8==0):
        return (True, n)
    sz = len(n)
    for i in range(sz):
        x = ''
        for j in range(sz):
            if j == i:
                continue
            x += n[j]
        ret = possible(x)
        if (ret != (-1, -1)):
            return ret
    return (-1, -1)



def solve():
    n = int(input())
    R = possible(str(n))
    if (R[0] != True):
        print("NO")
    else:
        print("YES")
        print(R[1])










if __name__ == '__main__':

    solve()
    # solve()




