#include <bits/stdc++.h>
using namespace std;
const long long LongINF = 1e13 + 7;
const int INF = 1e9 + 7;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class Y>
T GCD(T a, Y b) {
  if (a < b) {
    int c = a;
    a = b;
    b = c;
  }
  if (a % b == 0) {
    return b;
  }
  return GCD(b, a % b);
}
template <class T, class Y>
T LCM(T a, Y b) {
  return (a * b) / GCD(a, b);
}
void clear(queue<pair<int, int>>& q) {
  queue<pair<int, int>> empty;
  swap(q, empty);
}
using vi = vector<int>;
using vii = vector<vi>;
int main() {
  int n;
  cin >> n;
  vi a(n);
  map<int, int> mp;
  for (long long i = (0); i < (n); i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  int l = mp.size();
  if (mp[0] != 0 && l == 1) {
    cout << "Yes" << endl;
  } else if (l == 2) {
    int cnt = 0;
    for (auto x : mp) {
      if (x.first == 0 && x.second == n / 3)
        cnt++;
      else if (x.first != 0 && x.second == 2 * n / 3)
        cnt++;
      else {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
  } else if (l == 3 && mp[0] == 0) {
    int xr = 0;
    for (auto x : mp) {
      xr ^= x.first;
    }
    if (xr != 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
