$dx = [-2, -2, -1, -1, 1, 1, 2, 2] $dy = [-1, 1, -2, 2, -2, 2, -1, 1] $cx = 0 $cy = 0 def process(x, y, n) if $cx == x && $cy == y return true elsif n >= 3 return false end find = false 8.times do |i| find = process(x + $dx[i], y + $dy[i], n + 1) if find break end end return find end str = gets.split $cx = str[0].to_i $cy = str[1].to_i if process(0, 0, 0) puts "YES" else puts "NO" end