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

public class Codeforces {
    final static long mod = 1000000007;

    public static void main(String[] args) {
        FastReader sc = new FastReader();
        String s=sc.next();
        int n=s.length();
        
        boolean flag=true;
        
        if(s.contains("144")){
            s=s.replaceAll("144","   ");
        }
        // System.out.print(s+"->");
        if(s.contains("14")){
            s=s.replaceAll("14","  ");
        }
        // System.out.print(s+"->");
        
        if(s.contains("1")){
            s=s.replaceAll("1"," ");
        }
        // System.out.print(s+"->");
        
        s=s.replaceAll(" ","");
        System.out.println(s.length()==0?"YES":"NO");
    }
    
    static long modulo(long a,long b){
        //Modulo function takes case of modulus work if the remainder comes out to be negative in some case
        long c=a%b;
        return c<0?c+b:c; 
    }
    static class FastReader {

        BufferedReader br;
        StringTokenizer st; // StringTokenizer() is used to read long strings

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

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

    static class Pair implements Comparable<Pair> {
        public final int index;
        public final int value;

        public Pair(int index, int value) {
            this.index = index;
            this.value = value;
        }

        
//         @Override
// 		public int compareTo(Pair o) {
// 			if(this.x>o.x)
// 				return 1;
// 			else if(this.x<o.x)
// 				return -1;
// 			else {
// 				if(this.y>o.y)
// 					return 1;
// 				else if(this.y<o.y)
// 					return -1;
// 				else
// 					return 0;
// 			}
// 		}
        @Override
        public int compareTo(Pair other) {
            // multiplied to -1 as the author need descending sort order
            return -1 * Integer.valueOf(this.value).compareTo(other.value);
        }
    }

    static String reverseString(String str) {
        StringBuilder input = new StringBuilder();
        return input.append(str).reverse().toString();
    }

    static long factorial(int n, int b) {
        if (n == b)
            return 1;

        return n * factorial(n - 1, b);
    }

    static int lcm(int ch, int b) {
        return ch * b / gcd(ch, b);
    }

    static int gcd(int ch, int b) {
        return b == 0 ? ch : gcd(b, ch % b);
    }

    static double ceil(double n, double k) {
        return Math.ceil(n / k);
    }

    static int sqrt(double n) {
        return (int) Math.sqrt(n);
    }

}