a=[] for _ in range(2): a.append(input()) print('NYOE S'['4.8.1'in a::2])