object Main {
  def main(args: Array[String]) = {

    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val I = List.fill(N)(sc.nextInt)
    sc.close()

    (0 until I.length - 2).forall(i => (I(i) ^ I(i + 1)) == I(i + 2)) match {
      case true => println("Yes")
      case _    => println("No")
    }
  }
}