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

/**
 *
 * @author farah
 */
public class AhmadAli {

    /**
     * @param args the command line arguments
     */
    public static void light() {
        Scanner sc = new Scanner(System.in);
        int arr[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                arr[i][j] = sc.nextInt();
            }
        }

        int sumArr[][] = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                sumArr[i][j] = arr[i][j];
                for (int k = 0; k < 3; k++) {

                    if (j != k) {
                        sumArr[i][j] += arr[i][k];
                    }

                    if (i != k) {
                        sumArr[i][j] += arr[k][j];
                    }

                }
            }
        }
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(sumArr[i][j] + " ");
            }
            System.out.println("");
        }
        System.out.println(",,,,,,,,,,,,,,,,,,,,,");
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                if (sumArr[i][j] % 2 == 0) {
                    sumArr[i][j] = 1;
                } else {
                    sumArr[i][j] = 0;
                }
            }
        }

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                System.out.print(sumArr[i][j]);
            }
            System.out.println("");
        }

    }

    public static boolean majic(String s) {
        for (int i = 0; i < s.length(); i++) {
            if (s.charAt(i) != '1') {
                return false;
            }

            if (i+1 < s.length() && s.charAt(i + 1) == '4') {
                i++;
                if (i+1 < s.length() && s.charAt(i + 1) == '4') {
                    i++;
                    
                }
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
       if(majic(s))
            System.out.println("YES");
       else
            System.out.println("NO");
                   

    }
}
