D = gets.split.map(&:to_i) D.permutation do |nums| ok = true nums.each_cons(3) do |a, b, c| ok = false if a == b ok = false if a == c ok = false if b == c ok = false if a < b && b < c ok = false if a > b && b > c ok = false if a > c end if ok puts 'YES' exit end end puts 'NO'