A. Magic Numberstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputA 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.InputThe first line of input contains an integer n, (1 ≤ n ≤ 109). This number doesn't contain leading zeros.OutputPrint "YES" if n is a magic number or print "NO" if it's not.ExamplesInput114114OutputYESInput1111OutputYESInput441231OutputNO
Input114114
OutputYES
['brute force', 'greedy', '*900']