#include <bits/stdc++.h>
using namespace std;
int n;
vector<long long> a(100000);
int wa[100000];
int binary(int bina) {
  int ans = 0;
  for (int i = 0; bina > 0; i++) {
    ans = ans + (bina % 2) * pow(10, i);
    bina = bina / 2;
  }
  return ans;
}
void solve() {
  bool ans = true;
  wa[0] = a[n - 1] ^ a[1];
  wa[n - 1] = a[n - 2] ^ a[0];
  if (a[0] != wa[0] || a[n - 1] != wa[n - 1]) {
    cout << "No\n";
    return;
  }
  for (int i = 0; i < (int)(n - 2); i++) {
    wa[i + 1] = a[i] ^ a[i + 2];
    if (a[i + 1] != wa[i + 1]) {
      ans = false;
      break;
    }
  }
  if (ans == true)
    cout << "Yes\n";
  else
    cout << "No\n";
}
int i = 0;
int rep_cnt = 0;
void solver() {
  if (i == n - 1) {
    wa[i] = a[0] ^ a[i - 1];
    if (a[i] == wa[i])
      cout << "Yes\n";
    else
      cout << "No\n";
    return;
  }
  wa[i] = a[i - 1] ^ a[i + 1];
  if (a[i] != wa[i]) {
    int tmp = a[i + 1];
    a.erase(a.begin() + i + 1);
    a.insert(a.begin() + n - 2, tmp);
    rep_cnt++;
    if (rep_cnt > n - i) {
      cout << "No\n";
      return;
    }
    solver();
  } else {
    i++;
    rep_cnt = 0;
    solver();
  }
}
int rep0_cnt = 0;
void solver_0() {
  wa[0] = a[n - 1] ^ a[1];
  if (a[0] == wa[0]) {
    i++;
    rep_cnt = 0;
    solver();
    return;
  } else if (rep_cnt < n - rep0_cnt - 1) {
    int tmp = a[i + 1];
    a.erase(a.begin() + i + 1);
    a.insert(a.begin() + n - 2, tmp);
    rep_cnt++;
    solver_0();
  } else {
    int tmp = a[n - 1];
    a.erase(a.begin() + n - 1);
    a.insert(a.begin() + 1, tmp);
    rep_cnt = 0;
    rep0_cnt++;
    if (rep0_cnt > n / 2) {
      cout << "No\n";
      return;
    }
    solver_0();
    return;
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
    a[i] = binary(a[i]);
  }
  solver_0();
  return 0;
}
