object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val grouping = (i: Int) => i match {
    case 1 | 3 | 5 | 7 | 8 | 10 | 12 => "A"
    case 2 => "B"
    case _ => "C"
  }
  val x, y = sc.nextInt()
  println(if (grouping(x) == grouping(y)) "Yes" else "No")
}
