puts'00112020304051314162324253343645'.index(gets.split.map{|e|e.to_i.abs}.minmax*'')?:YES: :NO