#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
const long long inf = 1e18;
using namespace std;
long long n;
long long a[101010];
map<long long, long long> mp;
int main() {
  cin >> n;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (mp.size() == 1 && mp.count(0)) {
    cout << "Yes" << endl;
  } else if (n % 3 == 0 && mp.size() == 2 && mp.count(0) && mp[0] == n / 3) {
    cout << "Yes" << endl;
  } else if (n % 3 == 0 && mp.size() == 3) {
    bool flag = true;
    long long x[3];
    long long cnt = 0;
    for (auto itr : mp) {
      x[cnt] = itr.first;
      cnt++;
      if (itr.second != n / 3) flag = false;
    }
    if (flag && (x[0] ^ x[1] ^ x[2] == 0))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
