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.util.Scanner;

public class C {
	public static void main(String[] args) {

		// Read string
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		sc.close();
		
		char[] seq;

		// Remove trailing odds
		int cutoff = str.length() - 1;
		seq = str.toCharArray();
		for (; cutoff > 0; cutoff--) {
			if (seq[cutoff] % 2 == 0) {
				break;
			}
		}
		seq = str.substring(0, cutoff + 1).toCharArray();

		// Degenerate cases
		if (seq.length < 3) {
			if (!handleDegenerates(seq)) {
				System.out.println("NO");
			}
			return;
		}

		// Case 000
		if (findAndPrintYes(seq, 0, 0, 0)) {
			return;
		}

		// Case 016
		if (findAndPrintYes(seq, 0, 1, 6)) {
			return;
		}

		// Case 024
		if (findAndPrintYes(seq, 0, 2, 4)) {
			return;
		}

		// Case 032
		if (findAndPrintYes(seq, 0, 3, 2)) {
			return;
		}

		// Case 104
		if (findAndPrintYes(seq, 1, 0, 4)) {
			return;
		}

		// Case 112
		if (findAndPrintYes(seq, 1, 1, 2)) {
			return;
		}

		// Case 120
		if (findAndPrintYes(seq, 1, 2, 0)) {
			return;
		}

		// Case 136
		if (findAndPrintYes(seq, 1, 3, 6)) {
			return;
		}

		// If not accepted, reject
		System.out.println("NO");
	}

	static boolean findAndPrintYes(char[] seq, int two, int four, int eight) {
		int r;
		int c;
		int l;

		for (r = seq.length - 1; r > 1; r--) {
			if (seq[r] % 8 == eight) {
				break;
			}
		}

		if (r == 1) {
			return handleDegenerates(new String(seq).substring(0, 2)
					.toCharArray());
		}

		for (c = r - 1; c > 0; c--) {
			if (seq[c] % 4 == four) {
				break;
			}
		}

		if (c == 0) {
			return handleDegenerates((new String(seq).substring(0, 1) + seq[r])
					.toCharArray());
		}

		for (l = c - 1; l > -1; l--) {
			if (seq[l] % 2 == two) {
				break;
			}
		}

		if (l == -1) {
			return handleDegenerates((seq[c] + "" + seq[r]).toCharArray());
		}

		System.out.println("YES");
		String sub = (new String(seq)).substring(0, l + 1);
		System.out.println(sub + seq[c] + "" + seq[r]);
		return true;
	}

	static boolean handleDegenerates(char[] seq) {
		if (seq.length == 2) {
			if (new Integer(seq[0] + "" + seq[1]) % 8 == 0) {
				System.out.println("YES");
				System.out.println(seq[0] + "" + seq[1]);
				return true;
			} else if (seq[0] % 8 == 0) {
				System.out.println("YES");
				System.out.println("" + seq[0]);
				return true;
			} else if (seq[1] % 8 == 0) {
				System.out.println("YES");
				System.out.println("" + seq[1]);
				return true;
			}
		}

		if (seq.length == 1 && seq[0] % 8 == 0) {
			System.out.println("YES");
			System.out.println("" + seq[0]);
			return true;
		}

		return false;
	}
}