Problem: 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.

Input

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. 

Output

Print "NO" (without quotes), if there is no such way to remove some digits from number n. 

Otherwise, print "YES" in the first line and the resulting number after removing digits from number n in the second line. The printed number must be divisible by 8.

If there are multiple possible answers, you may print any of them.

Examples

Input

3454


Output

YES
344


Input

10


Output

YES
0


Input

111111


Output

NO

Solution (in JAVA):

Solution:
/* with dp */
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.StringTokenizer;

public class Main
{

	public static void main(String[] args) throws IOException
	{

		Main main = new Main();
		main.read();
	}

	/* IO */
	private StringBuilder ans;
	private BufferedReader in;
	private StringTokenizer tok;

	/* fields */
	private int n;
	private int[] nums;
	private int[][][] dp;
	private DpState[][][] prev;

	private void read() throws IOException
	{
		// streams
		boolean file = false;
		if (file)
			in = new BufferedReader(new FileReader("input.txt"));
		else
			in = new BufferedReader(new InputStreamReader(System.in));
		ans = new StringBuilder();

		// read all
		StringBuilder strb = new StringBuilder();
		String str = in.readLine();
		while (str != null)
		{
			strb.append(str.trim());
			strb.append(" ");
			str = in.readLine();
		}
		tok = new StringTokenizer(strb.toString().trim());

		// read
		String num = tok.nextToken().trim();
		n = num.length();
		nums = new int[n];
		for (int i = 0; i < n; i++)
			nums[i] = num.charAt(i) - '0';

		// solve
		System.out.println(solve());

	}

	private String solve()
	{
		// clear dp
		dp = new int[n][8][8];
		for (int i = 0; i < n; i++)
			for (int j = 0; j < 8; j++)
				for (int k = 0; k < 8; k++)
					dp[i][j][k] = -1;
		prev = new DpState[n][8][8];

		// form string
		StringBuilder strb = new StringBuilder();
		f(n - 1, 0, 1);
		DpState curr = new DpState(n - 1, 0, 1, false);
		while (curr != null && curr.idx >= 0)
		{
			curr = prev[curr.idx][curr.prevMod][curr.mod10];
			if (curr != null && curr.taken)
				strb.append(nums[curr.idx + 1] + "");
		}

		return strb.length() == 0 ? "NO" : "YES\n" + strb.reverse().toString();
	}

	private int f(int idx, int prevMod, int mod10)
	{
		// base case
		if (idx == -1)
			return prevMod == 0 ? 1 : 0;
		if (dp[idx][prevMod][mod10] != -1)
			return dp[idx][prevMod][mod10];

		// leave it
		int ans = 0;
		if (f(idx - 1, prevMod, mod10) == 1)
		{
			ans = 1;
			prev[idx][prevMod][mod10] = new DpState(idx - 1, prevMod, mod10, false);
		}

		// take it
		int newMod = (prevMod + nums[idx] * mod10) % 8;
		int newMod10 = (mod10 * 10) % 8;
		if (f(idx - 1, newMod, newMod10) == 1)
		{
			ans = 1;
			prev[idx][prevMod][mod10] = new DpState(idx - 1, newMod, newMod10, true);
		}

		return dp[idx][prevMod][mod10] = ans;
	}

}

class DpState
{
	int idx, prevMod, mod10;
	boolean taken;

	public DpState(int idx, int prevMod, int mod10, boolean taken)
	{
		this.idx = idx;
		this.prevMod = prevMod;
		this.mod10 = mod10;
		this.taken = taken;
	}
}