y, m, d = map(int, input().split()) if y == 1989: if m == 1: if d <= 7: print('No') else: print('Yes') else: print('Yes') elif y == 2019: if m <= 4: print('Yes') else: print('No') elif y < 1989: print('No') elif 1989 < y < 2019: print('Yes') else: print('No')