#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<int, int> f;
  set<int> t;
  vector<int> r;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (!f[x]) {
      t.insert(x);
      r.push_back(x);
    }
    f[x]++;
  }
  if (n % 3) {
    if (t.size() == 1 && f[0] == n)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (t.size() != 3) {
    cout << "No" << endl;
  } else {
    if (r[0] ^ r[2] == r[1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
