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 Main {
    Scanner sc = new Scanner(System.in);
    void doIt(){
        String n = sc.next() + "e";
        int i = 0;
        int cnt = 2;
        while((n.charAt(i) == '1') || (n.charAt(i)=='4')){
            if((n.charAt(i)=='4')){
                cnt++;
                if(cnt > 2)break;
            }
            else cnt = 0;
            i++;
        }
        if((n.charAt(i)=='e'))System.out.println("YES");
        else System.out.println("NO");
    }
    public static void main(String[] args) {
        new Main().doIt();
    }
    
    // thanks to wata
    class Scanner {
        InputStream in;
        byte[] buf = new byte[1 << 10];
        int p, n;
        boolean[] isSpace = new boolean[128];
        Scanner(InputStream in) {
            this.in = in;
            isSpace[' '] = isSpace['\n'] = isSpace['\r'] = isSpace['\t'] = true;
        }
        int read() {
            if (n == -1) return -1;
            if (p >= n) {
                p = 0;
                try {
                    n = in.read(buf);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
                if (n <= 0) return -1;
            }
            return buf[p++];
        }
        boolean hasNext() {
            int c = read();
            while (c >= 0 && isSpace[c]) c = read();
            if (c == -1) return false;
            p--;
            return true;
        }
        String next() {
            if (!hasNext()) throw new InputMismatchException();
            StringBuilder sb = new StringBuilder();
            int c = read();
            while (c >= 0 && !isSpace[c]) {
                sb.append((char)c);
                c = read();
            }
            return sb.toString();
        }
        int nextInt() {
            if (!hasNext()) throw new InputMismatchException();
            int 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 - '0';
                c = read();
            } while (c >= 0 && !isSpace[c]);
            return res * sgn;
        }
        long nextLong() {
            if (!hasNext()) throw new InputMismatchException();
            int c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (c >= 0 && !isSpace[c]);
            return res * sgn;
        }
        double nextDouble() {
            return Double.parseDouble(next());
        }
    }

}

