import java.util.Scanner

object Main extends App {

  val sc: Scanner = new Scanner(System.in)
  val n: Int = sc.nextInt()
  val ls: IndexedSeq[Int] = IndexedSeq.fill(n)(sc.nextInt())

  for (i <- 0 until ls.length) {
    if ((ls(i) ^ ls((i + 2) % ls.length)) != ls((i + 1) % ls.length)) {
      println("No")
      System.exit(0)
    }
  }

  println("Yes")

}