#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (*max_element(a, a + n) == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  map<long long, long long> mp;
  for (long long i = 0; i < n; i++) {
    mp[a[i]]++;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 3) {
    vector<long long> v;
    for (auto x : mp) v.push_back(x.first);
    if (mp[v[0]] == n / 3 && mp[v[1]] == n / 3 && v[0] ^ v[1] == v[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (mp.size() == 2) {
    if (mp[0] == n / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
