#include <bits/stdc++.h>
using namespace std;
const int sz = 1e5 + 1, mod = 1e9 + 7;
long long n, a[sz];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int i, j;
  cin >> n;
  unordered_map<long long, int> mp;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  vector<long long> v;
  for (auto x : mp) {
    if (n % 3 == 0 && x.second == n / 3) v.push_back(x.first);
  }
  if (mp[0] == n) {
    cout << "Yes";
  } else if (n % 2 == 0 && mp[0] == n / 2 && mp[1] == n / 2) {
    cout << "Yes";
  } else if (v.size() == 3) {
    if (v[0] ^ v[1] == v[2] || v[1] ^ v[2] == v[0] || v[0] ^ v[2] == v[1])
      cout << "Yes";
    else
      cout << "No";
  } else
    cout << "No";
}
