#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)1e18;
const long long MOD = (long long)1e9 + 7;
string yn(bool f) { return f ? "Yes" : "No"; }
string YN(bool f) { return f ? "YES" : "NO"; }
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  long long N, zero = 0;
  vector<long long> a;
  map<long long, long long> mp;
  cin >> N;
  a.resize(N);
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
    if (!a[i]) zero++;
    mp[a[i]]++;
  }
  if (zero == N) {
    cout << "Yes"
         << "\n";
  } else if (N % 3) {
    cout << "No"
         << "\n";
  } else if (mp.size() == 2) {
    if (mp[0] == N / 3)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  } else if (mp.size() == 3) {
    long long Xor = 0;
    for (pair<long long, long long> p : mp) {
      Xor ^= p.first;
      if (p.second != N / 3) {
        cout << "No"
             << "\n";
        return 0;
      }
    }
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
  return 0;
}
