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 sys
input = sys.stdin.readline
from math import log2,ceil
from collections import Counter,deque

mod = 998244353
graph = {}
def add_edge(node1,node2):
    if node1 not in graph[node2]:
        graph[node2].append(node1)
    if node2 not in graph[node1]:
        graph[node1].append(node2)
    
def dfs(node,vis,nums,graph):
    q = [[node,1]]
    colors = [1,1] + [10**7]*(max(nums)+1)
    colors[node] = 1
    vis[node] = True
    while q:
        a ,c = q.pop()
        for child in graph[a]:
            if vis[child] is True:
                continue
            check = []
            for i in graph[child]:
                check.append(colors[i])
            newc = mex(check)
            colors[child] = newc
            vis[child] = True
            q.append([child,newc])
    return colors
            
    
def bfs(node,posi,visted,graph):
    visted[node] = posi
    q = deque()
    ans = 1
    q.append([node,posi])
    while q:
        vert , c = q.popleft()
        ans = (ans*c) % mod
        for child in graph[vert] :
            if child in visted :
                if visted[child] == c :
                    return 0
                else:
                    continue 
            if c == 2:
                new = 1
            else:
                new = 2
            visted[child] = new
            q.append([child,new])
    return ans
def mex(arr):
    N = len(arr)
    # Sort the array
    arr1 = arr.copy()
    arr1.sort()
    
    mex = 1 # change this to 0 
    for idx in range(N):
        if arr1[idx] == mex:

            # Increment mex
            mex += 1

    # return mex as answer
    return mex
    
def div(n):
    q = [n]
    while q:
        w = q.pop()
        l = len(w)
        if l == 1:
            if int(w)%8 == 0 and int(w) != 0:
                return w
            else:
                continue
        new = w[1:]
        if int(new)%8 == 0 and int(new) != 0:
            return new
        k = 10**l
        b = k/10
        q.append(str(new))
        h = int(w)
        while k != 1:
            hehe = int(((h-h%k) // 10) + (h%b))
            if hehe%8 == 0 and hehe != 0:
                return hehe
            q.append( str(hehe) ) 
            k /= 10
            b /= 10
    return -1
        
stop_reading_my_code = 1 # int(input().strip())
for _ in range(stop_reading_my_code):
    n = input().strip()
    if int(n)%8 ==0 :
        print("YES")
        print(n)
    #arr = list(map(int,input().strip().split()))
    ans = div(n)
    if  ans == -1:
        print("NO")
    else:
        print("YES")
        print(ans)
    
    
                    