object Main extends App {
	val Array(x, y) = scala.io.StdIn.readLine.split(" ").map(_.toInt)

	val a1 = Set(1,3,5,7,8,10,12)
	val a2 = Set(4,6,9,11)
	val a3 = Set(2)

	if(a1.contains(x) && a1.contains(y)){
		println("Yes")
	}else if(a2.contains(x) && a2.contains(y)){
		println("Yes")
	}else if(a3.contains(x) && a3.contains(y)){
		println("Yes")
	}else{
		println("No")
	}


} 
