import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

object Main {
  def main(args: Array[String]): Unit = {
    val in = new BufferedReader(new InputStreamReader(System.in))
    val out = new PrintWriter(new BufferedOutputStream(System.out))
    val inputs = in.readLine().split("\\s+").map(_.toInt)

    out.println(
      if (inputs.map(input => List(
        List(1, 3, 5, 7, 8, 10, 12),
        List(4, 6, 9, 11),
        List(2)
      ).indexWhere(_.contains(input))).distinct.length == 1) {
        "Yes"
      } else {
        "No"
      }
    )

    out.flush()
  }
}
