#include <bits/stdc++.h>
using namespace std;
const long long int INF = (1LL << 50);
template <class S, class T>
std::ostream& operator<<(std::ostream& os, pair<S, T> a) {
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template <class T>
std::ostream& operator<<(std::ostream& os, vector<T> a) {
  os << "[ ";
  for (int i = 0; i < a.size(); i++) {
    os << a[i] << " ";
  }
  os << " ]";
  return os;
}
const string YES = "Yes";
const string NO = "No";
void p(string s) {
  cout << s << endl;
  exit(0);
}
map<long long int, long long int> x;
vector<long long int> X;
void inc_x(long long int a) {
  if (x.count(a)) {
    ++x[a];
  } else {
    x[a] = 1;
    X.push_back(a);
  }
}
void solve(long long N, std::vector<long long> a) {
  for (int i = 0; i < N; i++) inc_x(a[i]);
  if (x.size() > 3 || x.size() < 1) p(NO);
  if (N % 3 != 0) {
    if ((long long int)x.count(0LL) == N)
      p(YES);
    else
      p(NO);
  } else
    switch (x.size()) {
      case 1UL:
        if ((long long int)x.count(0LL) == N)
          p(YES);
        else
          p(NO);
      case 2UL:
        if ((long long int)x.count(0LL) == N / 3)
          p(YES);
        else
          p(NO);
      case 3UL:
        if (x[X[0]] == N / 3 && x[X[1]] == N / 3 && 0LL == (X[0] ^ X[1] ^ X[2]))
          p(YES);
        else
          p(NO);
    }
  p(NO);
}
int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> a(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
  }
  solve(N, std::move(a));
  return 0;
}
