#include <bits/stdc++.h>
using namespace std;
const int inf = 1001001000;
const long long INF = 1LL << 60;
const int MOD = (int)1e9 + 7;
bool check(set<int> a) {
  vector<int> t(3);
  int i = 0;
  for (auto x : a) {
    t[i] = x;
    ++i;
  }
  if ((t[1] ^ t[2]) == t[0]) {
    return true;
  } else
    return false;
}
int main() {
  int N;
  cin >> N;
  vector<int> in(N);
  for (int i = 0; i < N; ++i) cin >> in[i];
  set<int> cnt;
  for (int i = 0; i < N; ++i) {
    cnt.insert(in[i]);
  }
  if (cnt.size() == 1 && cnt.count(0) == 1) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (cnt.size() == 3 && check(cnt)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
