#include <bits/stdc++.h>
using namespace std;
int n, x[300000], jenis;
map<int, bool> m;
vector<int> v;
bool cek;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x[i];
    if (m[x[i]]) continue;
    jenis++;
    m[x[i]] = true;
    v.push_back(x[i]);
    if (x[i] != 0) cek = true;
  }
  if (n % 3 != 0 || jenis != 3) {
    if (!cek)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (v[0] ^ v[1] ^ v[2] == 0) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
