#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
template <class T, class U>
void amax(T& x, U y) {
  if (x < y) x = y;
}
template <class T, class U>
void amin(T& x, U y) {
  if (x > y) x = y;
}
const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (N); ++i) cin >> a[i];
  bool result = true;
  for (int i = 0; i < (N); ++i) {
    if (a[i] != a[(i + 3) % N]) {
      result = false;
      break;
    }
  }
  if (result) {
    int x = a[0], y = a[1], z = a[2];
    result = ((x == (y ^ z)) && (y == (z ^ x)) && (z == (x ^ y)));
  }
  cout << (result ? "Yes" : "No") << endl;
  return 0;
}
