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.*;
import java.io.*;
import java.math.*;

public class BasicJava
{
   public static InputReader in = new InputReader( System.in );
   public static OutputWriter out = new OutputWriter( System.out );

   public static boolean[][] dp = new boolean[10][110];
   public static int[][] predx = new int[10][110];
   public static int[][] predy = new int[10][110];
   public static boolean[][] predi = new boolean[10][110];
   
   public static StringBuilder ans = new StringBuilder("");
   public static String s = new String("");
   
   public static void find_path(int x, int y)
   {
      if (x == -1) return; else
      {
         find_path(predx[x][y], predy[x][y]);
         
         if (predi[x][y]) ans.append(s.charAt(y));
      }
   }
   
   public static void main(String[] args)
   {
      s = in.nextLine();
      
      s = s.substring(0, s.length()-1);
      
      int n = s.length();
      
      s = "!" + s;
      
      for (int i = 1; i <= n; i++) {
         
         for (int j = 0; j < 8; j++)
            if (dp[j][i-1]) {
               dp[(j*10+(s.charAt(i)-48))%8][i] = true;
               predx[(j*10+(s.charAt(i)-48))%8][i] = j;
               predy[(j*10+(s.charAt(i)-48))%8][i] = i - 1;
               predi[(j*10+(s.charAt(i)-48))%8][i] = true;
            }
         
         for (int j = 0; j < 8; j++)
            if (dp[j][i-1]) {
               dp[j][i] = true;
               predx[j][i] = j;
               predy[j][i] = i - 1;
               predi[j][i] = false;
            }
         
         dp[(s.charAt(i) - 48) % 8][i] = true;
         predx[(s.charAt(i) - 48) % 8][i] = -1;
         predy[(s.charAt(i) - 48) % 8][i] = -1;
         predi[(s.charAt(i) - 48) % 8][i] = true;
      }
      
      if (dp[0][n]) out.println("YES"); else {
         out.println("NO");
         out.close();
         System.exit(0);
      }
      
      find_path(0, n);
      
      out.println(ans.toString());
      
      out.close();
   }
   
   static class InputReader
   {
       private InputStream stream;
       private byte[] buf = new byte[1024];
       private int curChar;
       private int numChars;
 
       public InputReader(InputStream stream)
       {
           this.stream = stream;
       }
 
       public InputReader(FileReader fileReader)
      {
         // TODO Auto-generated constructor stub
      }
 
      public int read()
       {
           if (numChars == -1)
               throw new InputMismatchException();
 
           if (curChar >= numChars)
           {
               curChar = 0;
               try
               {
                   numChars = stream.read(buf);
               } catch (IOException e)
               {
                   throw new InputMismatchException();
               }
               if (numChars <= 0)
                   return -1;
           }
 
           return buf[curChar++];
       }
 
       public int nextInt()
       {
           int c = read();
 
           while (isSpaceChar(c))
               c = read();
 
           int sgn = 1;
 
           if (c == '-')
           {
               sgn = -1;
               c = read();
           }
 
           int res = 0;
 
           do
           {
               if (c < '0' || c > '9')
                   throw new InputMismatchException();
 
               res *= 10;
               res += c & 15;
 
               c = read();
           } while (!isSpaceChar(c));
 
           return res * sgn;
       }
 
       public int[] nextIntArray(int arraySize)
       {
           int array[] = new int[arraySize];
 
           for (int i = 0; i < arraySize; i++)
               array[i] = nextInt();
 
           return array;
       }
 
       public long nextLong()
       {
           int c = read();
 
           while (isSpaceChar(c))
               c = read();
 
           int sign = 1;
 
           if (c == '-')
           {
               sign = -1;
 
               c = read();
           }
 
           long result = 0;
 
           do
           {
               if (c < '0' || c > '9')
                   throw new InputMismatchException();
 
               result *= 10;
               result += c & 15;
 
               c = read();
           } while (!isSpaceChar(c));
 
           return result * sign;
       }
 
       public long[] nextLongArray(int arraySize)
       {
           long array[] = new long[arraySize];
 
           for (int i = 0; i < arraySize; i++)
               array[i] = nextLong();
 
           return array;
       }
 
       public float nextFloat() // problematic
       {
           float result, div;
           byte c;
 
           result = 0;
           div = 1;
           c = (byte) read();
 
           while (c <= ' ')
               c = (byte) read();
 
           boolean isNegative = (c == '-');
 
           if (isNegative)
               c = (byte) read();
 
           do
           {
               result = result * 10 + c - '0';
           } while ((c = (byte) read()) >= '0' && c <= '9');
 
           if (c == '.')
               while ((c = (byte) read()) >= '0' && c <= '9')
                   result += (c - '0') / (div *= 10);
 
           if (isNegative)
               return -result;
 
           return result;
       }
 
       public double nextDouble() // not completely accurate
       {
           double ret = 0, div = 1;
           byte c = (byte) read();
 
           while (c <= ' ')
               c = (byte) read();
 
           boolean neg = (c == '-');
 
           if (neg)
               c = (byte) read();
 
           do
           {
               ret = ret * 10 + c - '0';
           } while ((c = (byte) read()) >= '0' && c <= '9');
 
           if (c == '.')
               while ((c = (byte) read()) >= '0' && c <= '9')
                   ret += (c - '0') / (div *= 10);
 
           if (neg)
               return -ret;
 
           return ret;
       }
 
       public String next()
       {
           int c = read();
 
           while (isSpaceChar(c)) c = read();
 
           StringBuilder res = new StringBuilder();
 
           do
           {
               res.appendCodePoint(c); c = read();
           } while (!isSpaceChar(c));
 
           return res.toString();
       }
 
       public boolean isSpaceChar(int c)
       {
           return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
       }
 
       public String nextLine()
       {
           int c = read();
 
           StringBuilder result = new StringBuilder();
 
           do
           {
               result.appendCodePoint(c);
 
               c = read();
           } while (!isNewLine(c));
 
           return result.toString();
       }
 
       public boolean isNewLine(int c) { return c == '\n'; }
 
       public void close()
       {
           try
           {
               stream.close();
           } catch (IOException e)
           {
               e.printStackTrace();
           }
       }
 
   }
 
   static class OutputWriter
   {
       private PrintWriter writer;
 
       public OutputWriter(OutputStream stream)
       {
           writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
                   stream)));
       }
 
       public OutputWriter(Writer writer) { this.writer = new PrintWriter(writer); }
 
       public void println(int x) { writer.println(x); }
 
       public void print(int x) { writer.print(x); }
 
       public void println(char x) { writer.println(x); }
 
       public void print(char x) { writer.print(x); }
 
       public void println(int array[], int size)
       {
           for (int i = 0; i < size; i++) println(array[i]);
       }
 
       public void print(int array[], int size)
       {
           for (int i = 0; i < size; i++)
               print(array[i] + " ");
       }
 
       public void println(long x) { writer.println(x); }
 
       public void print(long x) { writer.print(x); }
 
       public void println(long array[], int size)
       {
           for (int i = 0; i < size; i++)
               println(array[i]);
       }
 
       public void print(long array[], int size)
       {
           for (int i = 0; i < size; i++)
               print(array[i]);
       }
 
       public void println(float num) { writer.println(num); }
 
        
       public void print(float num) { writer.print(num); }
 
       public void println(double num) { writer.println(num); }
 
       public void print(double num) { writer.print(num); }
 
       public void println(String s) { writer.println(s); }
 
       public void print(String s) { writer.print(s); }
 
       public void println() { writer.println(); }
 
       public void printSpace() { writer.print(" "); }
 
       public void printf(String format, Object args) { writer.printf(format, args); }
 
       public void flush() { writer.flush(); }
 
       public void close() { writer.close(); }
 
   }
}