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.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Round189_A {

    public void solve() throws Exception {

        InputReader in = new InputReader();

        char[] a = in.next().toCharArray();
        int N = a.length;

        int index = 0;
        while (index < N) {

            if (index < N - 2 && a[index] == '1' && a[index + 1] == '4'
                    && a[index + 2] == '4') {
                index += 3;
            } else if (index < N - 1 && a[index] == '1' && a[index + 1] == '4')
                index += 2;
            else if (a[index] == '1')
                index++;
            else {
                System.out.println("NO");
                return;
            }

        }
        System.out.println("YES");
    }

    public static void main(String[] args) throws Exception {
        new Round189_A().solve();

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer st;

        public InputReader() throws IOException {
            in = new BufferedReader(new InputStreamReader(System.in));
            st = new StringTokenizer(in.readLine());

        }

        public String next() throws IOException {

            while (!st.hasMoreElements())
                st = new StringTokenizer(in.readLine());
            return st.nextToken();
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }

}
