import scala.io.StdIn._

object Main extends App {

  val n = readInt()
  val a = readLine().split(" ").map(_.toInt)

  def solve() = {
    val allZero = a.forall(_ == 0)
    val distinct = a.distinct
    val threeType = distinct.length == 3 &&
      a.groupBy(identity).toSeq.map(_._2.length).distinct.length == 1 &&
      distinct.drop(1).foldLeft(distinct.head) { (acc, num) => acc ^ num } == 0
    
    if(allZero || threeType) "Yes" else "No"
  }

  println(solve())

}

