object Main extends App {
  val sc = new java.util.Scanner(System.in)
//  val l = List.fill(3)(sc.nextInt)
  val x, y = sc.nextInt

  val group = Map(
    1 -> Seq(1, 3, 5, 7, 8, 10, 12),
    2 -> Seq(4, 6, 9, 11),
    3 -> Seq(2)
  )

  val ans = if (group.find(_._2.contains(x)) == group.find(_._2.contains(y))) "Yes" else "No"
  println(ans)
}