import java.util.Scanner object Problem240 { def main(args: Array[String]) = { val sc = new Scanner(System.in) val x = sc.nextInt() val y = sc.nextInt() val result = proc(x, y, 3) println(result) } def proc(targetX: Int, targetY: Int, stepLimit: Int): String = { val dxy = List((-2, -1), (-2, 1), (-1, -2), (-1, 2), (1, -2), (1, 2), (2, -1), (2, 1)) var found = false def procR(x: Int, y: Int, steps: Int): Unit = { if (x == targetX && y == targetY) { found = true return } if (steps == stepLimit || found) { return } for ((dx, dy) <- dxy) { procR(x + dx, y + dy, steps + 1) } } procR(0, 0, 0) if (found) { "YES" } else { "NO" } } }