#include <bits/stdc++.h>
using namespace std;
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;
}
struct io {
  io() {
    ios::sync_with_stdio(false);
    cin.tie(0);
  };
};
const long long int MOD = 1000000007;
const int INF = INT_MAX;
const long long int LLINF = 1LL << 62;
int main(void) {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  map<int, int> m;
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  for (int i = 0; i < (v.size()); ++i) m[v[i]]++;
  if (m.size() == 1 && m[0] == n)
    cout << ("Yes") << endl;
  else if (m.size() == 2 && n % 3 == 0 && m[0] == n / 3)
    cout << ("Yes") << endl;
  else if (m.size() == 3 && n % 3 == 0) {
    if (((v[0] ^ v[1]) == v[2]) && m[v[0]] == n / 3 && m[v[1]] == n / 3)
      cout << ("Yes") << endl;
    else
      cout << ("No") << endl;
  } else
    cout << ("No") << endl;
}
