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 sys

input = sys.stdin.readline


def I(): return input().strip()


def II(): return int(input().strip())


def LI(): return [*map(int, input().strip().split())]


import string, math, time, functools, random, fractions
from heapq import heappush, heappop, heapify
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict, Counter, OrderedDict
from itertools import permutations, combinations, groupby, count, filterfalse
from operator import itemgetter

for _ in range(1):
    n = II()
    lst = str(n)
    f = 0
    if len(lst)==3:
        if lst != "144" and lst != "114" and lst != "111" and lst != "141":
            print("NO")
            continue
        else:
            print("YES")
            continue
    if len(lst) == 2:
        if lst != "11" and lst != "14":
            print("NO")
            continue
        else:
            print("YES")
            continue
    if len(lst) == 1:
        if lst == "1":
            print("YES")
            continue
        else:
            print("NO")
            continue

    if lst[0] == "4":
        print('NO')
        continue
    for i in range(len(lst)-3):
        if lst[i] != "4" and  lst[i] != "1":
            print('NO')
            f = 1
            break

        if lst[i] == "1":
            if lst[i+1] == "4":
                if lst[i+2] == "4":
                    if lst[i+3] == "4":
                        print("NO")
                        f = 1
                        break
                    elif lst[i + 1] != "1" and lst[i + 1] != "4":
                        print('NO')
                        f = 1
                        break
                elif lst[i + 1] != "1" and lst[i + 1] != "4":
                    print('NO')
                    f = 1
                    break

            elif lst[i+1] != "1" and lst[i+1] != "4":
                print('NO')
                f = 1
                break



    if f == 0:
        print("YES")



