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:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;

public class Main {

	static int MOD = 1000 * 1000 * 1000 + 7;

	public static void shuffleArray(int[] arr) {
		int n = arr.length;
		Random rnd = new Random();
		for (int i = 0; i < n; ++i) {
			int tmp = arr[i];
			int randomPos = i + rnd.nextInt(n - i);
			arr[i] = arr[randomPos];
			arr[randomPos] = tmp;
		}
	}

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		solve(in, out);
		out.close();
		System.exit(0);
	}

	private static void solve(InputReader in, PrintWriter out) {
		char[] s = in.next().toCharArray();
		int n = s.length;
		for (int i = 0; i < n; i++) {
			s[i] -= '0';
			if (s[i] == 0) {
				out.println("YES");
				out.print("0");
				return;
			}
		}
		boolean[][] dp = new boolean[n][8];
		int[][][] mem = new int[n][8][3];
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < 8; j++) {
				mem[i][j][0] = -1;
			}
		}
		dp[0][s[0] % 8] = true;
		mem[0][s[0] % 8][0] = s[0];
		mem[0][s[0] % 8][1] = -1;
		mem[0][s[0] % 8][2] = -1;

		for (int i = 1; i < n; i++) {
			for (int r = 0; r < 8; r++) {
				dp[i][r] = dp[i - 1][r];
				for (int k = 0; k < 3; k++) {
					mem[i][r][k] = mem[i - 1][r][k];
				}
			}
			int dig = s[i] % 8;
			dp[i][dig] = true;
			mem[i][dig][0] = s[i];
			mem[i][dig][1] = -1;
			mem[i][dig][2] = -1;
			for (int r = 0; r < 8; r++) {
				if (dp[i - 1][r]) {
					dp[i][(10 * r + dig) % 8] = true;
					mem[i][(10 * r + dig) % 8][0] = s[i];
					mem[i][(10 * r + dig) % 8][1] = i - 1;
					mem[i][(10 * r + dig) % 8][2] = r;
				}
			}
		}

		if (dp[n - 1][0]) {
			out.println("YES");
			StringBuilder sb = new StringBuilder();
			int pos = n - 1;
			int res = 0;
			for (int i = n - 1; i >= 0; i--) {
				sb.append((char) (mem[pos][res][0] + '0'));
				int a = mem[pos][res][1];
				int b = mem[pos][res][2];
				pos = a;
				res = b;
				if (pos == -1) {
					break;
				}
			}
			out.print(sb.reverse().toString());

		} else {
			out.print("NO");
		}

	}

	/*
	 * 
	 */
	// --------------------------------------------------------
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public double nextDouble() {
			return Double.parseDouble(next());
		}

		public String nextLine() {
			String str = "";
			try {
				str = reader.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}

			return str;
		}
	}

}