#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const int INF = 1e9;
const long long LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main() {
  int n;
  cin >> n;
  vector<long long> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  map<long long, int> mp;
  for (int i = 0; i < (n); ++i) mp[v[i]]++;
  if (mp.size() == 1) {
    if (mp[0] == n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 2) {
    if (n % 3 != 0)
      cout << "No" << endl;
    else if (mp[0] == 0)
      cout << "No" << endl;
    else {
      if (mp[0] == n / 3) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  } else if (mp.size() == 3) {
    if (n % 3 != 0)
      cout << "No" << endl;
    else {
      long long x = 0;
      for (auto p : mp) {
        x ^= p.first;
        if (p.second != n / 3) {
          cout << "No" << endl;
          return 0;
        }
        if (!x)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      }
    }
  } else {
    cout << "No" << endl;
  }
}
