import java.util.Scanner

object Main {
  def main(args:Array[String]): Unit = {
    val groups:List[List[Integer]] = List(List(1, 3, 5, 7, 8, 10, 12), List(4, 6, 9, 11), List(2))
    val sc = {
      new Scanner(System.in)
    }
    val x, y = sc.nextInt

    var answer = "No"

    groups.foreach( group => {
      if (group.contains(x) && group.contains(y)) {
        answer = "Yes"
      }
    })

    println(answer)
  }
}