A magic number is a number formed by concatenation of numbers 1, 14 and 144. We can use each of these numbers any number of times. Therefore 14144, 141414 and 1411 are magic numbers but 1444, 514 and 414 are not.

You're given a number. Determine if it is a magic number or not.

Input

The first line of input contains an integer n, (1 ≤ n ≤ 109). This number doesn't contain leading zeros.

Output

Print "YES" if n is a magic number or print "NO" if it's not.

Examples

Input

114114


Output

YES


Input

1111


Output

YES


Input

441231


Output

NO
//import sun.reflect.generics.tree.Tree;

import sun.awt.datatransfer.DataTransferer;

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.util.*;
import java.util.logging.LoggingMXBean;


public class citylights {
    public static int []arr;
    public static ArrayList<Integer>p;
    public static int []val;
    public static long []facto;
    public static int mod= 1000000007;
    public static long []fillme;
    // public static int []tt;



    public static void main(String[] args) {
        arr = new int[1000001];
        p = new ArrayList<>();
        val = new int[1000001];
        facto = new long[1000007];
        //tt=new int[100];

        fillme = new long[1000007];
        //sieve();

        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);

        String str=in.readString();
        for (int i=0;i<str.length();i++)
        {
              if(str.charAt(i)!='1' && str.charAt(i)!='4')
              {
                  out.println("NO");
                  out.close();
                  return;

              }

        }
        if(str.charAt(0)=='4')
        {
            out.println("NO");
            out.close();
            return;
        }
        if(str.contains("444"))
        {
            out.println("NO");
            out.close();
            return;
        }
        out.println("YES");







       out.close();
    }
    public static long bsearch(long []a,long t)
    {
        long ans=-1;
        long low=0;
        long high=a.length-1;
        while (low<=high)
        {
            long mid=(low+high)/2;
            if(a[(int) mid]<=t)
            {
                ans=mid;
                low=mid+1;
            }else
            {
                high=mid-1;
            }


        }
        return ans;


    }
    public static boolean check(String str)
    {
         Stack<Character>st=new Stack<>();
         for (int i=0;i<str.length();i++)
         {
             Character c=str.charAt(i);
               if(c=='A')
               {
                   if(st.isEmpty())
                   {
                       st.push(c);
                   }else
                   {
                        Character peek=st.peek();
                        if(peek!='A')
                        {
                            st.push(c);
                        }else
                            st.pop();

                   }




               }else
               {
                   if(st.isEmpty())
                   {
                       st.push(c);
                   }else
                   {
                       Character peek=st.peek();
                       if(peek=='B')
                       {
                           st.pop();
                       }else
                       {
                           st.push(c);
                       }
                   }




               }


         }
         return st.isEmpty();





    }

    public static int[]rotate(int []order,int by)
    {
        int length=order.length;
        int []a=new int[length];
        for (int i=0;i<length;i++)
        {
            a[(i+by)%length]=order[i];

        }
        return a;


    }
    public static long modinv(long x,long m)
    {
        return powmod(x,m-2,m);

    }
    public static long eulertoitent(long n)
    {
        long res = n;
        for (int i = 2; i * i <= n; i++)
            if (n % i == 0) {
                while (n % i == 0)
                    n /= i;
                res -= res / i;
            }
        if (n > 1)
            res -= res / n;
        return res;



    }

    //calculate factorial till modulas
    public static void fact()
    {
        facto[0]=1;
        for(int i=1;i<=mod;i++)
        {
            facto[i]=(i*facto[i-1])%mod;
        }


    }

    public static void sieve()
    {
        arr[0]=1;
        arr[1]=1;

        for(int i=2;i*i<1000001;i++)
        {
            if(arr[i]==0)
            {

                for(int j=i*i;j<1000001;j+=i)
                {
                    arr[j]=1;
                }
            }
        }
        for(int i=2;i<1000001;i++)
        {
            if(arr[i]==0)
                p.add(i);
        }
    }
    public static boolean isPrime(int n)
    {
        // Corner cases
        if (n <= 1)  return false;
        if (n <= 3)  return true;

        // This is checked so that we can skip
        // middle five numbers in below loop
        if (n%2 == 0 || n%3 == 0) return false;

        for (int i=5; i*i<=n; i=i+6)
            if (n%i == 0 || n%(i+2) == 0)
                return false;

        return true;
    }
    public static long euclgcd(long a,long b)
    {
        if(b==0)
            return a;
        else
            return euclgcd(b,a%b);

    }

    public static long powmod(long x,long n,long m) {
        long result = 1L;
        while (n > 0) {
            if (n % 2 == 1)
                result = (result * x) % m;
            x = (x * x) % m;
            n = n / 2;
        }

        return result;
    }



    static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }


}