#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline bool umin(T1& x, const T2& y) {
  return y < x ? x = y, true : false;
}
template <typename T1, typename T2>
inline bool umax(T1& x, const T2& y) {
  return x < y ? x = y, true : false;
}
const int N = (int)1e6 + 7;
const int mod = (int)1e9 + 7;
const int INF = (int)1e9 + 17;
const long long LLINF = (long long)1e18 + 17;
int n;
int a[N];
int b[N];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr), cout.tie(nullptr);
  cin >> n;
  map<int, int> cnt;
  for (int i = (0); i < (n); ++i) {
    cin >> a[i];
    ++cnt[a[i]];
  }
  if (cnt.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = (0); i < (n); ++i) {
    for (auto& p : cnt) {
      if (p.second == 0) continue;
      --p.second;
      b[i++] = p.first;
    }
    --i;
  }
  for (int i = (0); i < (n); ++i) {
    int x = (i - 1 + n) % n;
    int y = (i + 1) % n;
    if (b[i] != (b[x] ^ b[y])) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
