#include <bits/stdc++.h>
using namespace std;
class XY {
 public:
  long long x, y;
  XY() { x = y = 0; }
  XY(long long u, long long v) {
    x = u;
    y = v;
  }
};
template <typename T1, typename T2>
void chmin(T1 &a, T2 b) {
  if (a > b) a = b;
}
template <typename T1, typename T2>
void chmax(T1 &a, T2 b) {
  if (a < b) a = b;
}
template <typename T1, typename T2>
T1 mypow(T1 a, T2 n) {
  if (n == 0) return 1;
  if (n == 1) return a;
  if (n % 2) return a * mypow(a, n - 1);
  T1 tmp = mypow(a, n / 2);
  return tmp * tmp;
}
template <typename T>
int BS(vector<T> V, int left, int right, T key) {
  int mid = (left + right) / 2;
  if (V[mid] <= key)
    left = mid;
  else
    right = mid;
  if (right - mid == 1)
    return left;
  else
    return BS(V, left, right, key);
}
void Main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (long long i = 0; i < N; i++) cin >> A[i];
  map<int, int> mp;
  vector<int> v;
  for (long long i = 0; i < N; i++) {
    if (mp.find(A[i]) == mp.end()) {
      mp[A[i]] = 1;
      v.push_back(A[i]);
    } else {
      mp[A[i]]++;
    }
  }
  string res = "No";
  if (v.size() == 1) {
    if (v[0] == 0) res = "Yes";
  } else if (v.size() == 2) {
    if (v[0] == 0 && mp[v[0]] == 2 * mp[v[1]]) res = "Yes";
    if (v[1] == 0 && mp[v[1]] == 2 * mp[v[0]]) res = "Yes";
  } else if (v.size() == 3) {
    if (v[0] ^ v[1] == v[2] && mp[v[0]] == mp[v[1]] && mp[v[0]] == mp[v[2]])
      res = "Yes";
  }
  cout << res << endl;
}
int main() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << std::fixed << std::setprecision(15);
  Main();
}
