#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int infi = 2147483600;
const long long infl = 1e17;
int main() {
  int n;
  cin >> n;
  set<int> syu;
  map<int, int> cnt;
  for (long long i = 0; i < (long long)n; i++) {
    int a;
    cin >> a;
    syu.insert(a);
    cnt[a]++;
  }
  if (syu.size() == 1) {
    if (cnt[0] > 0) cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  } else if (syu.size() == 2) {
    vector<int> x;
    vector<int> y;
    for (auto p : syu) {
      x.push_back(p);
      y.push_back(cnt[p]);
    }
    if (y[0] * 2 == y[1]) {
      if (x[0] == 0) cout << "Yes" << endl;
      return 0;
    } else if (y[1] * 2 == y[0]) {
      if (x[1] == 0) cout << "Yes" << endl;
      return 0;
    }
  } else if (syu.size() == 3) {
    vector<int> x;
    vector<int> y;
    for (auto p : syu) {
      x.push_back(p);
      y.push_back(cnt[p]);
    }
    if (y[0] == y[1] && y[1] == y[2] && (x[0] ^ x[1]) == x[2] &&
        (x[1] ^ x[2]) == x[0] && (x[2] ^ x[0] == x[1]))
      cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
