h={[0,0]=>1} A=[[-2,-1],[-2,1],[-1,-2],[-1,2],[2,-1],[2,1],[1,-2],[1,2]] (1..3).each{|n| A.repeated_combination(n){|a|h[a.transpose.map{|e|e.reduce(:+).abs}]=1} } B=h.keys.sort.select{|x,y|x<=y}.map(&:join) #p B p B.include?(gets.split.map{|e|e.to_i.abs}.minmax*'')?:YES: :NO