#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> a;
bool has_valid_circle(vector<int> na) {
  if (na.size() == n) {
    if ((na[0] ^ na[n - 2]) != na[n - 1]) return false;
    if ((na[n - 1] ^ na[1]) != na[0]) return false;
  }
  for (int i = 1; i < na.size() - 1; ++i) {
    if ((na[i - 1] ^ na[i + 1]) != na[i]) return false;
  }
  return true;
}
void dfs(vector<int> na, vector<bool> used) {
  vector<int> tmp_na;
  vector<bool> tmp_used;
  if (na.size() > 1 and !has_valid_circle(na)) {
    cout << "No" << endl;
    return;
  }
  if (na.size() == n) {
    if (has_valid_circle(na)) {
      cout << "Yes" << endl;
      return;
    } else {
      cout << "No" << endl;
      return;
    }
  }
  for (int i = 0; i < n; ++i) {
    if (used[i]) continue;
    tmp_na = na;
    tmp_na.push_back(a[i]);
    tmp_used = used;
    tmp_used[i] = true;
    return dfs(tmp_na, tmp_used);
  }
}
int main() {
  cin >> n;
  a.resize(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  vector<int> na = {};
  vector<bool> used(n);
  fill(used.begin(), used.end(), false);
  dfs(na, used);
  return 0;
}
