#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int x = a[0];
  int y = a[1];
  multiset<int> s;
  for (int i = 2; i < n; ++i) {
    s.emplace(a[i]);
  }
  vector<int> b(n);
  b[0] = a[0];
  b[1] = a[1];
  for (int i = 2; i < n; ++i) {
    b[i] = x ^ y;
    if (s.find(b[i]) == s.end()) {
      cout << "No" << '\n';
      exit(0);
    }
    s.erase(s.find(b[i]));
  }
  for (int i = 0; i < n; ++i) {
    if ((a[i] ^ a[(i + 1) % n]) != a[(i + 2) % n]) {
      cout << "No" << '\n';
      exit(0);
    }
  }
  cout << "Yes" << '\n';
  return 0;
}
