import sequtils, strutils var y, m, d: int (y, m, d) = stdin.readLine.split.map parseInt let b = if y == 1989: if m == 1: d >= 8 else: true elif y == 2019: if m == 4: d == 30 else: m < 4 else: y > 1989 and y < 2019 echo ["No", "Yes"][ord b]