17 lines
340 B
Python
17 lines
340 B
Python
def main():
|
|
nb = input("")
|
|
poss = ["144", "14", "1"]
|
|
while nb != "":
|
|
ok = False
|
|
for i in poss:
|
|
if nb.startswith(i):
|
|
nb = nb[len(i):]
|
|
ok = True
|
|
break
|
|
if not ok:
|
|
print("NO")
|
|
return
|
|
print("YES")
|
|
|
|
|
|
main() |