S = list(map(int, input().split())) print('Yes' if [1989,1,7] < S < [2019,4,31] else 'No')