#include <bits/stdc++.h>
using namespace std;
int dy[] = {0, 0, 1, -1};
int dx[] = {1, -1, 0, 0};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
long long modpow(long long n, long long k) {
  if (k == 1) {
    return n;
  } else if (k == 0) {
    return 1;
  } else if (k % 2 == 0) {
    long long memo = modpow(n, k / 2) % 1000000007;
    return memo * memo % 1000000007;
  } else {
    return n * modpow(n, k - 1) % 1000000007;
  }
}
int main() {
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long> v;
  int count[3];
  count[0] = 1;
  count[1] = 1;
  count[2] = 1;
  for (int i = 0; i < n; i++) {
    bool b = false;
    for (int j = 0; j < v.size(); j++) {
      if (v[j] == a[i]) {
        b = true;
        if (j < 3) count[j]++;
        break;
      }
    }
    if (!b) {
      v.push_back(a[i]);
    }
    if (v.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (v.size() <= 1) {
    cout << "Yes" << endl;
    return 0;
  }
  if (v.size() == 2) {
    if (v[0] == 0 && count[1] == count[0] * 2) {
      cout << "Yes" << endl;
      return 0;
    }
    if (v[1] == 0 && count[0] == count[1] * 2) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  if (count[0] != count[1] || count[1] != count[2]) {
    cout << "No" << endl;
    return 0;
  }
  if (v[0] ^ v[1] == v[2] && v[1] ^ v[2] == v[0] && v[2] ^ v[0] == v[1]) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
