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