
import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)

  val x, y = sc.nextInt()

  val S = Set(4, 6, 9, 11)

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