#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  int a[100000];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (mp.count(a[i]) == 0) {
      mp[a[i]] = 1;
    } else {
      mp[a[i]]++;
    }
  }
  if (mp.size() == 1) {
    auto p = mp.begin();
    if (p->first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 2) {
    cout << "No" << endl;
  } else if (mp.size() == 3) {
    auto p = mp.begin();
    int a = p->first;
    p++;
    int b = p->first;
    p++;
    int c = p->first;
    if ((a == (b ^ c)) && (b == (c ^ a)) && (c == (a ^ b))) {
      if ((mp[a] == mp[b]) && (mp[b] == mp[c])) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
