#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> a;
  bool check = true;
  map<long long, int> mp;
  for (int i = 0; i < N; i++) {
    long long b;
    cin >> b;
    a.push_back(b);
    mp[b]++;
    if (b != 0) check = false;
  }
  if (check) {
    cout << "Yes" << endl;
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (mp[0] == N / 3) {
    for (int i = 0; i < N; i++) {
      if (mp[a[i]] == 2 * N / 3) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (a.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  if ((a[0] ^ a[1]) ^ a[2] == 0 && mp[a[0]] == mp[a[1]] == mp[a[2]] == N / 3) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
