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