#include <bits/stdc++.h>
using namespace std;
const int INF = (1 << 30) - 1;
const long long INFLL = (1LL << 61) - 1;
const int MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = (0); i < (N); ++i) {
    int tmp;
    cin >> tmp;
    mp[tmp]++;
  }
  bool ans = false;
  if (mp[0] == N) ans = true;
  if (N % 3 != 0) {
    if (mp.size() == 2) {
      if (mp[0] == N) ans = true;
    }
    if (mp.size() == 3) {
      if ((mp.begin()->first ^ mp.begin()++->first ^ (mp.begin()++)++->first) ==
              0 &&
          mp.begin()->second == N / 3 && mp.begin()++->second == N / 3)
        ans = true;
    }
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
