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
# sys.setrecursionlimit(400000)
input=lambda:sys.stdin.readline().strip()
# write=lambda x:sys.stdout.write(str(x)+'\n')

# from decimal import Decimal
# from datetime import datetime,timedelta
# from random import randint
# from copy import deepcopy
from collections import deque,Counter
# from heapq import heapify,heappush,heappop
# from bisect import bisect_left,bisect,insort
from math import inf,sqrt,gcd,pow,ceil,floor,log,log2,log10,pi,sin,cos,tan,asin,acos,atan
# from functools import cmp_to_key,reduce
# from operator import or_,xor,add,mul
# from itertools import permutations,combinations,accumulate

def solve():
    s=input()
    n=len(s)
    dp=[[False]*8 for i in range(n)]
    prev=[[-1]*8 for i in range(n)]

    dp[0][int(s[0])%8]=True
    for i in range(1,n):
        for j in range(8):
             if dp[i-1][j]:
                dp[i][(10*j+int(s[i]))%8]=True
                prev[i][(10*j+int(s[i]))%8]=j

                dp[i][j]=True
                prev[i][j]=j
        dp[i][int(s[i])%8]=True
    if dp[n-1][0]:
        print('YES')
        for i in range(n):
            if dp[i][0]:
                pi=i;pj=0
                ans=[]
                while True:
                    if prev[pi][pj]==-1 or prev[pi][pj]!=pj:
                        ans.append(s[pi])
                    if prev[pi][pj]==-1:
                        break
                    pj=prev[pi][pj]
                    pi-=1
                ans.reverse()
                ans=''.join(ans)
                print(ans)
                return
    print('NO')
    return

# t=int(input())
# for _ in range(t):
#     solve()

solve()