import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)
  val x = sc.nextInt()
  val y = sc.nextInt()

  val a = Set(1, 3, 5, 7, 8, 10, 12)
  val b = Set(4, 6, 9, 11)

  println(if (x != 2 && y != 2 && (a.contains(x) && a.contains(y) || b.contains(x) && b.contains(y))) "Yes" else "No")
}