#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  vector<int> u(n);
  vector<int> v;
  for (int i = 0; i < n; i++) cin >> u[i];
  int flag = 0;
  sort(u.begin(), u.end());
  v.push_back(u[n - 1]);
  for (int i = n - 2; i >= 0; i--) {
    if ((n - 1 - i) % 2 == 1)
      v.insert(v.begin(), u[i]);
    else
      v.push_back(u[i]);
  }
  for (int i = 1; i < n - 1; i++) {
    if ((v[i - 1] ^ v[i + 1]) == v[i])
      flag = 0;
    else {
      flag = 1;
      break;
    }
  }
  if (v[0] != (v[1] ^ v[n - 1])) flag = 1;
  if (v[n - 1] != (v[0] ^ v[n - 2])) flag = 1;
  if (flag == 1)
    cout << "No";
  else
    cout << "Yes";
}
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
