#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() == 1) {
    for (auto x : mp) {
      if (x.first == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 2) {
    vector<pair<int, int>> A;
    for (auto x : mp) {
      A.push_back({x.first, x.second});
    }
    sort(A.begin(), A.end());
    if ((A[0].first == 0) && (A[0].second == n / 3) &&
        (A[1].second == (2 * n / 3))) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (mp.size() == 3) {
    vector<int> A, B;
    for (auto x : mp) {
      A.push_back(x.first);
      B.push_back(x.second);
    }
    if ((A[0] ^ A[1] == A[2]) && (A[1] ^ A[2] == A[0]) &&
        (A[2] ^ A[0] == A[1]) && (B[0] == B[1]) && (B[1] == B[2])) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
