#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
template <typename T>
void remove(std::vector<T> &vector, char index) {
  vector.erase(vector.begin() + index);
}
template <class T>
T ma(std::vector<T> &v) {
  T maxi = 0;
  for (auto &i : v) maxi = max(maxi, i);
  return maxi;
}
template <class T>
T mi(std::vector<T> &v) {
  T mini = 0;
  for (auto &i : v) mini = min(mini, i);
  return mini;
}
template <class T>
T pow(T x, T y, T n = numeric_limits<T>::max()) {
  if (y == 0) return 1;
  if (y % 2 == 0) return pow((x * x) % n, y / 2);
  return (x * pow(x, y - 1)) % n;
}
int gcd(int x, int y) {
  if (x < y) swap(x, y);
  return !y ? x : gcd(x % y, y);
}
using Graph = vector<vector<int>>;
template <class T, class S>
class Edge {
  T to;
  S weight;

 public:
  Edge(T t, S w) : to(t), weight(w) {}
};
int ansi = 0;
long long ansl = 0;
double ansd = 0.0;
int accumul(int mul) {
  if (mul == 0) {
    return 1;
  } else {
    return mul * accumul(mul - 1);
  }
}
int main() {
  unsigned long long n;
  vector<int> a(n + 2);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  a[0] = a[n];
  a[n + 1] = a[1];
  for (int i = 1; i <= n; i++) {
    int s = a[i - 1] ^ a[i + 1];
    if (a[i] != s) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
}
