#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    if (mp.find(a) != mp.end()) {
      mp[a] += 1;
    } else {
      mp[a] = 1;
    }
  }
  if (mp.size() == 1) {
    if (mp.begin()->first == 0) {
      cout << "Yes" << endl;
      return 0;
    }
  } else if (mp.size() == 2) {
    auto itr = mp.begin();
    int a1 = itr->first, cnt1 = itr->second;
    ++itr;
    int a2 = itr->first, cnt2 = itr->second;
    if (a1 < a2) {
      if (a1 == 0 && cnt1 * 2 == cnt2) {
        cout << "Yes" << endl;
        return 0;
      }
    } else {
      if (a2 == 0 && cnt2 * 2 == cnt1) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  } else if (n % 3 == 0 && mp.size() == 3) {
    auto itr = mp.begin();
    int a1 = itr->first, cnt1 = itr->second;
    ++itr;
    int a2 = itr->first, cnt2 = itr->second;
    ++itr;
    int a3 = itr->first, cnt3 = itr->second;
    if (a1 ^ a2 ^ a3 == 0 && cnt1 == n / 3 && cnt2 == n / 3 && cnt3 == n / 3) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
