puts'001123345 024 036 04 05 13 14 16 24'.index(gets.split.map{|e|e.to_i.abs}.minmax*'')?:YES: :NO