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