#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1 << 29);
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  map<int, int> mp;
  for (int i = 0; i < (N); i++) {
    cin >> a[i];
    if (!mp.count(a[i])) {
      mp.emplace(a[i], 1);
    } else {
      mp[a[i]]++;
    }
  }
  bool can = false;
  if (mp.size() == 1 && mp[0] == N)
    can = true;
  else if (mp.size() == 2 && mp[0] == N / 3)
    can = true;
  else {
    if (mp.size() == 3) {
      int a[3];
      int i = 0;
      for (auto x : mp) {
        a[i] = x.first;
        i++;
        if (x.second != N / 3) {
          break;
        }
      }
      if (a[0] xor a[1] xor a[2] == 0) can = true;
    }
  }
  cout << (can ? "Yes" : "No") << endl;
  return 0;
}
