#include <bits/stdc++.h>
using namespace std;
template <class T>
void print(const T &x) {
  cout << x << endl;
}
template <class T, class... A>
void print(const T &first, const A &...rest) {
  cout << first << " ";
  print(rest...);
}
struct PreMain {
  PreMain() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} premain;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int(i) = 0; (i) < (int)(N); ++(i)) cin >> A[i];
  if (N % 3 != 0) {
    print("No");
    return 0;
  }
  map<int, int> mp;
  for (int(i) = 0; (i) < (int)(N); ++(i)) {
    mp[A[i]]++;
  }
  vector<pair<int, int> > vec(mp.begin(), mp.end());
  if ((vec[0].first ^ vec[1].first) == vec[2].first && vec[0].second == N / 3 &&
      vec[1].second == N / 3 && vec[2].second == N / 3) {
    print("Yes");
  } else {
    print("No");
  }
  return 0;
}
