#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int n;
  bool zf = false;
  cin >> n;
  vector<pair<long long, long long>> v(3);
  int c = 0;
  for (int i = 0; i < 3; i++) v[i].first = -1;
  for (int i = 0; i < n; i++) {
    long long t;
    cin >> t;
    if (t == 0) zf = true;
    bool flag = true;
    for (int i = 0; i < 3; i++) {
      if (v[i].first == t) {
        v[i].second++;
        flag = false;
      }
    }
    if (flag) {
      if (c > 2) {
        c++;
      } else {
        v[c].first = t;
        v[c].second = 1;
        c++;
      }
    }
  }
  if (c > 3) {
    cout << "No" << endl;
    return 0;
  }
  sort(v.begin(), v.end());
  if (zf) {
    if (c == 1) {
      cout << "Yes" << endl;
      return 0;
    }
    if (c == 3) {
      cout << "No" << endl;
      return 0;
    }
    if (v[1].second + 1 == v[2].second) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  } else {
    if (c < 3) {
      cout << "No" << endl;
      return 0;
    }
    if (c == 3) {
      if (n % 3 == 0) {
        if (((v[0].first) == ((v[1].first) ^ (v[2].first))) &&
            ((v[1].first) == ((v[2].first) ^ (v[0].first))) &&
            ((v[2].first) == ((v[0].first) ^ (v[1].first)))) {
          if (v[0].second == v[1].second && v[1].second == v[2].second) {
            cout << "Yes" << endl;
            return 0;
          }
        }
      }
      cout << "No" << endl;
      return 0;
    }
  }
  return 0;
}
