start = {"y":1989,"m":1,"d":8} end = {"y":2019,"m":4,"d":30} Y,M,D = map(int,input().split()) is_heisei = start["y"] < Y < end["y"] if not is_heisei: if Y>=start["y"]: if start["y"]==Y: if start["m"]<=M: is_heisei=start["d"]<=D elif end["y"]==Y: if end["m"]>=M: is_heisei=end["d"]>=D print("Yes" if is_heisei else "No")