object Main extends App {
  val Array(x, y) = io.StdIn.readLine.split(" ").map(_.toInt)
  def f(n:Int):Int = {
    if(n == 2) 3
    else if(n == 4 || n == 6 || n == 9 || n == 11) 2
    else 1
  }
  val ans = if(f(x) == f(y)) "Yes" else "No"
  println(ans)
}