import sys input=lambda: sys.stdin.readline().rstrip() y,m,d=map(int,input().split()) if y<=1988 or y>=2020: print("No") elif 1990<=y<=2018: print("Yes") elif y==1989: if m>=2: print("Yes") else: if d>=8: print("Yes") else: print("No") else: if m>=5: print("No") else: print("Yes")