import scala.io.StdIn.readLine import scala.collection.mutable.PriorityQueue import scala.annotation.tailrec // PriorityQueue[Long]()(scala.math.Ordering.Long.reverse) package Lib { object EnRich { implicit class AString(val self : String) extends AnyVal { def splitToIntArray = self.split(" ").map(_.toInt) } } } import Lib.EnRich._ object Main { def go(x : Int, y : Int, k : Int = 3) : Set[(Int,Int)] = { if(k == 0) Set((x,y)) else { (for(i <- Vector(-2,-1,1,2); j <- Vector(-2,-1,1,2); if Math.abs(i) + Math.abs(j) == 3) yield (i,j) ).map({case (i,j) => go(x+i,y+j,k-1)}) .fold(Set[(Int,Int)]())(_ ++ _) + ((x,y)) } } def main(args : Array[String]) : Unit = { val (x,y) = { val xy = readLine.splitToIntArray (xy(0),xy(1)) } val ans = if(go(0,0,3) contains (x,y)) "YES" else "NO" println(ans) } }