import sequtils, strutils let read = iterator: string {.closure.} = while true: for s in stdin.readLine.split: yield s proc readInt: int = read().parseInt let Y, M, D = readInt() if Y > 1989 and Y < 2019: echo "Yes" elif Y == 1989 and ((M == 1 and D >= 8) or M >= 2): echo "Yes" elif Y == 2019 and ((M == 4 and D <= 30) or M < 4): echo "Yes" else: echo "No"