#include <bits/stdc++.h>
using namespace std;
long double const pi = 3.141592653589793238462;
long long int const mod = 1e9 + 7;
long long int const mod1 = 1e9 + 6;
long long int power(long long int a, long long int b) {
  long long int f = 1;
  while (b > 0) {
    if (b & 1) {
      f = f * a;
      f %= mod;
    }
    a = a * a;
    a %= mod;
    b = b / 2;
  }
  return f;
}
long long int inverse_mod(long long int x) { return power(x, mod - 2); }
long long int const N = 2e5 + 5;
int32_t main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int n, i, j, l;
  cin >> n;
  long long int a[n];
  long long int x[3] = {0};
  j = 0;
  map<long long int, long long int> mp;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    if (mp[a[i]] == 0) {
      mp[a[i]]++;
      if (j == 3) {
        cout << "No"
             << "\n";
        return 0;
      }
      x[j] = a[i];
      j++;
    } else {
      mp[a[i]]++;
    }
  }
  if (n % 3) {
    if (mp[0] == n) {
      cout << "Yes"
           << "\n";
    } else {
      cout << "No"
           << "\n";
    }
  } else {
    if (j == 3) {
      if (x[0] == x[1] ^ x[2]) {
        if (mp[x[0]] == mp[x[1]] && mp[x[0]] == mp[x[2]]) {
          cout << "Yes"
               << "\n";
        } else {
          cout << "No"
               << "\n";
        }
      } else {
        cout << "No"
             << "\n";
      }
    } else if (j == 1) {
      if (x[0] == 0) {
        cout << "Yes"
             << "\n";
      } else {
        cout << "No"
             << "\n";
      }
    } else if (j == 2) {
      if (mp[0] == n / 3) {
        cout << "Yes"
             << "\n";
      } else {
        cout << "No"
             << "\n";
      }
    } else {
      cout << "No"
           << "\n";
    }
  }
  return 0;
}
