#include <bits/stdc++.h>
using namespace std;
template <class c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c *x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug &operator<<(const c &) {
    return *this;
  }
};
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) {
    long long x;
    cin >> x;
    a[i] = x;
  }
  bool ok = true;
  for (int i = 0; i < n; ++i) {
    if (i == 0) {
      long long f = a[n - 1];
      if ((long long)(f ^ a[i + 1]) != a[0]) ok = false;
    } else if (i == n - 1) {
      long long f = a[n - 2];
      if ((long long)(f ^ a[0]) != a[n - 1]) ok = false;
    } else {
      long long f = a[i - 1];
      if ((long long)(f ^ a[i + 1]) != a[i]) ok = false;
    }
  }
  cout << (ok ? "Yes" : "No") << '\n';
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
}
