import scala.io.StdIn._

object Main extends App {

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

  def solve() = {
    val set = a.toSet
    // All 0
    val allZero = a.forall(_ == 0)

    // The number of each num is n/3
    val threeNums = set.size == 3 &&
      a.groupBy(identity).toSeq.map(_._2.length).distinct.length == 1

    // 0 and 2 nums.(x,y)
    val zeroAnd2Types = threeNums && set(0)

    // 3 nums (x,y,z). (x ^ y ^ z == 0)
    val threeType = threeNums &&
      set.drop(1).foldLeft(set.head) { (acc, num) => acc ^ num } == 0

    if(allZero || zeroAnd2Types || threeType) "Yes" else "No"
  }

  println(solve())

}

