y, m, d = map(int, input().split()) if y <= 1988 or y > 2020: print("No") elif y == 1989: if m == 1 and d <= 7: print("No") else: print("Yes") elif y == 2019: if m >= 5: print("No") else: print("Yes") else: print("Yes")