import scala.io.StdIn


object Main extends App {
  val n = StdIn.readLine().toInt
  val a :Array[Int]  = StdIn.readLine().split(" ").map(_.toInt)

  def solve(n: Int, a : Array[Int]): String = {
    val ans = "No"

    (1 to a.length - 1).foreach {i =>
      val init = a.indexOf(a(0) ^ a(i))
      if (init == -1) return "No"
      val acc = Array(a(0), a(init), a(i))
      val target = (a.take(init) ++ a.drop(init))

      if (condition(target, acc, a) == "Yes") return "Yes"
    }

    ans
  }

  def condition(t: Array[Int], acc: Array[Int], a: Array[Int]): String = {
    var target = t
    var retval: Array[Int] = acc
    (1 to a.length - 3).foreach {j =>
      val x = acc(j) ^ acc(j + 1)
      val y = target.indexOf(x)
      if ( y == -1) {
        return "No"
      } else {
        target = target.take(y) ++ target.drop(y)
        retval = retval :+ x
      }
    }

    if ((retval(0) ^ retval(retval.length - 1)) == retval(retval.length - 2)) "Yes" else "No"
  }

  println(solve(n, a))

}
  

