#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  vector<int> a(n);
  for (int i = 0; i < (int)n; i++) {
    int x;
    cin >> x;
    mp[x]++;
    a[i] = x;
  }
  sort((a).begin(), (a).end());
  if (mp.size() >= 4) {
    cout << "No" << endl;
  } else if (mp.size() == 3) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      if (a[0] ^ a[n / 3] ^ a[n / 3 * 2] == 0 &&
          a[n / 3 - 1] ^ a[n / 3 * 2 - 1] ^ a[n - 1] == 0) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  } else if (mp.size() == 2) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      if (a[n / 3 - 1] == 0 && a[n / 3] != 0) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  } else {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    } else {
      if (a[0] == 0) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  return 0;
}
