import scala.io.StdIn

object Main extends App {
  val a = StdIn.readLine().split(" ").map(_.toInt)

  def gr2(n: Int) = n == 4 || n == 6 || n == 9 || n == 11
  
  val r = if(a(0) == 2 || a(1) == 2) "No"
  else if(gr2(a(0)) && gr2(a(1))) "Yes"
  else if(gr2(a(0)) || gr2(a(1))) "No"
  else "Yes"
  
  println(r)
  
}
