def knight(x,y,n) case n when 0 x -= 2 y -= 1 when 1 x -= 2 y += 1 when 2 x -= 1 y -= 2 when 3 x -= 1 y += 2 when 4 x += 1 y -= 2 when 5 x += 1 y += 2 when 6 x += 2 y -= 1 when 7 x += 2 y += 1 end return x,y end X,Y = gets.split.map(&:to_i) x = y = tmp1_x = tmp1_y = tmp2_x = tmp2_y = 0 if X.abs > 6 || Y.abs > 6 puts "NO" else 8.times{|i| x = y = 0 tmp1_x,tmp1_y = knight(x,y,i) x,y = tmp1_x,tmp1_y if x == X && y == Y puts "YES" exit end 8.times{|j| x,y = tmp1_x,tmp1_y tmp2_x,tmp2_y = knight(x,y,j) x,y = tmp2_x,tmp2_y if x == X && y == Y puts "YES" exit end 8.times{|k| x,y = tmp2_x,tmp2_y x,y = knight(x,y,k) if x == X && y == Y puts "YES" exit end } } } puts "NO" end