import sequtils, strutils let xs = stdin.readLine.split.map parseInt y = xs[0] m = xs[1] d = xs[2] 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 if b: echo "Yes" else: echo "No"