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


public class CF {
	
	
	

	
	static class Pair{
	int x,y;
	public Pair(int a, int b) {
		this.x=a;
		this.y=b;
	}
}

	static class in {
	    static BufferedReader reader;
	    static StringTokenizer tokenizer;

	    /** call this method to initialize reader for InputStream */
	    static void init(InputStream input) {
	        reader = new BufferedReader(
	                     new InputStreamReader(input) );
	        tokenizer = new StringTokenizer("");
	    }

	    /** get next word */
	    static String next() throws IOException {
	        while ( ! tokenizer.hasMoreTokens() ) {
	            //TODO add check for eof if necessary
	            tokenizer = new StringTokenizer(
	                   reader.readLine() );
	        }
	        return tokenizer.nextToken();
	    }

	    static int nextInt() throws IOException {
	        return Integer.parseInt( next() );
	    }
		
	    static double nextDouble() throws IOException {
	        return Double.parseDouble( next() );
	    }
	    static long nextLong() throws IOException {
	        return Long.parseLong( next() );
	    }
	}
	
	public static int[] ini(int n)throws IOException {
		
		int[] arr=new int[n];
		for(int i=0;i<n;i++) {
			arr[i]=in.nextInt();
		}
		return arr;
		
	}
	
	public static long[] inl(int n)throws IOException {
		
		long[] arr=new long[n];
		for(int i=0;i<n;i++) {
			arr[i]=in.nextLong();
		}
		return arr;
		
	}
	
	public static int gcd(int a, int b) {
		if(b==0) {
			return a;
		}
		return gcd (b,a%b);
	}
	public static long gcd(long a, long b) {
		if(b==0) {
			return a;
		}
		return gcd (b,a%b);
	}
	public static int lcm(int a, int b) {
		return (a*b)/gcd(a,b);
	}
	public static int max(int[] arr) {
		int max=Integer.MIN_VALUE;
		for(int i=0;i<arr.length;i++) {
			max=Math.max(max, arr[i]);
		}
		return max;
	}
	
	public static long max(long[] arr) {
		long max=Long.MIN_VALUE;
		for(int i=0;i<arr.length;i++) {
			max=Math.max(max, arr[i]);
		}
		return max;
	}
	public static int min(int[] arr) {
		int min=Integer.MAX_VALUE;
		for(int i=0;i<arr.length;i++) {
			min=Math.min(min, arr[i]);
		}
		return min;
	}
	
	public static long min(long[] arr) {
		long min=Long.MAX_VALUE;
		for(int i=0;i<arr.length;i++) {
			min=Math.min(min, arr[i]);
		}
		return min;
	}
	
	public static void reverse(int[] arr, int low, int high) {
		
		int temp;
        while (low<high) {
            temp = arr[low];
            arr[low] = arr[high];
            arr[high] = temp;
            low++;
            high--;
        }
		
	}
	public static void reverse(long[] arr, int low, int high) {
		
		long temp;
        while (low<high) {
            temp = arr[low];
            arr[low] = arr[high];
            arr[high] = temp;
            low++;
            high--;
        }
		
	}
	public static int binarySearch(int arr[], int l, int r, int x)
    {
        if (r >= l) {
            int mid = l + (r - l) / 2;
  
            if (arr[mid] == x)
            	return mid;
           
            if (arr[mid] > x)
                return binarySearch(arr, l, mid - 1, x);
  
            return binarySearch(arr, mid + 1, r, x);
        }

        return -1;
    }
	
	public static void swap(char[] arr, int i, int j) {
		
		char x=arr[i];
		arr[i] = arr[j];
		arr[j] = x;
	}
	
	
	
	public static int sum(int[] arr) {
		
		
		int sum=0;
		int n  =arr.length;
				
		for(int i=0;i<n;i++) {
			sum+=arr[i];
		}
		
		return sum;
	}
	
	
	public static ArrayList<Integer> sieveOfEratosthenes(int n)
    {
        boolean prime[] = new boolean[n + 1];
        for (int i = 0; i <= n; i++)
            prime[i] = true;
 
        for (int p = 2; p * p <= n; p++)
        {
           
            if (prime[p] == true)
            {
                
                for (int i = p * p; i <= n; i += p)
                    prime[i] = false;
            }
        }

       ArrayList<Integer> lol=new ArrayList<Integer>();
       
       for(int i=2;i<=n;i++) {
    	   if(prime[i] ==true) {
    		   lol.add(i);
    	   }
       }
       
       return lol;
    }
	
	
	
	
	
	static boolean isPrime(int n)
    {
    
        if (n <= 1) return false;
     
        
        for (int i = 2; i < Math.sqrt(n); i++)
            if (n % i == 0)
                return false;
     
        return true;
    }

	
	
	
	
	
	
	
	/**************************************************************************************/
	
	static int countDigit(long  n)
	{
	    int count = 0;
	    while (n != 0)
	    {
	        n = n / 10;
	        ++count;
	    }
	    return count;
	}
	
	
	
	public static void solve() {
		
	}
	
public static void merge(int[] s1, int[] s2, int[] des){
        
        int i=0;
        int j=0;
        int k=0;
        
        while(i<s1.length && j<s2.length){
            if(s1[i]<=s2[j]){
                des[k]=s1[i];
                i++;
            }
            
            else{
                des[k]=s2[j];
                j++;
            }
            k++;
        }
        
        if(i<s1.length){
            while(i<s1.length){
                des[k]=s1[i];
                i++;
                k++;
            }
        }
        if(j<s2.length){
            while(j<s2.length){
                des[k]=s2[j];
                j++;
                k++;
            }
        }
        
    }

    public static void mergeSort(int[] input){
        
        
        // Write your code here
       if(input.length<=1){
           return;
       }
        
        int[] s1=new int[input.length/2];
        int[] s2=new int[input.length-s1.length];
        
        for(int i=0;i<s1.length;i++){
            s1[i]=input[i];
        }
        
        for(int i=s1.length;i<input.length;i++){
            s2[i-s1.length]=input[i];
        }
        
        mergeSort(s1);
        mergeSort(s2);
        merge(s1,s2,input);
        
        
        
        
    }
	
	
	
	

	public static void main(String[] args)throws IOException {
		// TODO Auto-generated method stub
		in.init(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		
		int n=in.nextInt();
		
		String s=String.valueOf(n);
		
		int flag=0;
		
	
		
		int cons4=0;
		for(int i=0;i<s.length();i++) {
			
			if(i==0) {
				if(s.charAt(i)!='1') {
					flag=1;
					break;
				}
				else {
					cons4=0;
				}
			}
			
			if(s.charAt(i)!='1' && s.charAt(i)!='4') {
				flag=1;
				break;
			}
			
			if(s.charAt(i)=='4') {
				cons4++;
			}
			
			if(s.charAt(i)=='1') {
				cons4=0;
			}
			
			if(cons4>=3) {
				flag=1;
				break;
			}
		}
		
		if(flag==1 ) {
			pw.println("NO");
		}
		
		
		else {
			pw.println("YES");
		}
		pw.flush();
		
		pw.close();
		
	}

}
