a,b,c = map(int,input().split()) if a > 1989 and a < 2019: print("Yes") elif a == 2019: if b > 4: print("No") else: print("Yes") elif a == 1989: if b != 1: print("Yes") else: if c > 7: print("Yes") else: print("No") else: print("No")