import scala.io.StdIn

object Main extends App {
  val j = Array(0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0)
  val a = StdIn.readLine().split(" ").map(_.toInt - 1)

  println(if(j(a(0)) == j(a(1))) "Yes" else "No")

}
