#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int in() {
  int x;
  cin >> x;
  return x;
}
long long lin() {
  long long x;
  cin >> x;
  return x;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline void print(pair<T, T> p) {
  cout << "(" << p.first << "," << p.second << ") ";
}
template <typename T>
istream& operator>>(istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x;
  return is;
}
const long long INF = 1e9 + 7;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  set<long long> s;
  map<long long, long long> m;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
    m[a[i]]++;
  }
  if (s.size() == 1) {
    if (a[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (s.size() == 3) {
    vector<long long> b(3);
    long long i = 0;
    for (auto x : s) {
      b[i] = x;
      i++;
    }
    if (m[b[0]] == n / 3 && m[b[1]] == n / 3 && m[b[2]] == n / 3 &&
        b[0] ^ b[1] == b[2]) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
