puts gets.split.map(&:to_i).permutation.any?{|e|e.each_cons(3).all?{|a,b,c|aa&&b>c)}}?:YES: :NO