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
from __future__ import division
from collections import Counter as ctr
from math import ceil, log, factorial, sqrt
# reads a line of input and converts into a list of ints
# 1 1 3 => [1, 1, 3]
def rl():
    return [int(i) for i in raw_input().split()]

# reads n lines of input (if n defined) and returns a list of strings
# where each element is a line in the input
# abc
# abcdef
# => ['abc', 'abcdef']
# if n not defined, read first line to get number of lines
# 2
# abc
# abcdef
# => ['abc', 'abcdef']
def rm(n=None):
    if n is None:
        n = input()
    return [raw_input() for i in range(n)]

# same as rm, except converts each line to a list of ints like rl
def rlm(n=None):
    if n is None:
        n = input()
    return [rl() for i in range(n)]

def yn(b):
    if b:
        print "YES"
    else:
        print "NO"

s = raw_input()
while len(s)>0:
    if s[:3] == '144':
        s = s[3:]
        continue
    if s[:2] == '14':
        s = s[2:]
        continue
    if s[:1] == '1':
        s = s[1:]
        continue
    print 'NO'
    exit()
print 'YES'