EPS/29-01-24/magic.py
2024-01-30 15:04:05 +01:00

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()