y,m,d=map(int, input().split()) ans='No' if 19891:ans='Yes' else: if d>=8:ans='Yes' elif y==2019 and m<5:ans='Yes' print(ans)