Y, M, D = map(int, input().split()) if (Y < 2019 and Y > 1989 or Y == 1989 and M > 1 or Y == 1989 and M == 1 and D > 7 or Y == 2019 and M <= 4): print("Yes") else: print("No")