object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val x, y = sc.nextInt()
  val g = List(
    Set(1,3,5,7,8,10,12),
    Set(4,6,9,11),
    Set(2)
  )
  val gx = g.find(_(x))
  val gy = g.find(_(y))
  println(if (gx == gy) "Yes" else "No")
}
