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
s0 = True
s1 = False
s2 = False
s3 = False

isMagic = True
number = raw_input()
for i in range(len(number)):
	if s0:
		if number[i]=='1':
			s1 = True
			s0 = False
			s2 = False
			s3 = False
		else:
			isMagic = False
			break
	elif s1:
		if number[i] =='1':
			s1 = True
			s0 = False
			s2 = False			
			s3 = False
		elif number[i]=='4':
			s1 = False
			s0 = False
			s2 = True
			s3 = False
		else:
			isMagic = False
			break
	elif s2:
		if number[i]=='1':
			s1 = True
			s0 = False
			s2 = False
			s3 = False
		elif number[i]=='4':
			s1 = False
			s0 = False
			s2 = False
			s3 = True
		else:
			isMagic = False			
			break
	elif s3:
		if number[i]=='1':
			s1 = True
			s0 = False
			s2 = False
			s3 = False
		else:
			isMagic = False
			break
if (isMagic):
	print "YES"
else:
	print "NO"