import scala.io.StdIn

object Main extends App {
  val pat = Array(9,0,2,0,1,0,1,0,0,1,0,1,0)
  val r = StdIn.readLine().split(" ").map(_.toInt)
  if(pat(r(0)) == pat(r(1))) println("Yes")
  else println("No")

}