#include <bits/stdc++.h>
using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  Int N;
  cin >> N;
  map<Int, Int> cnt;
  Int a;
  for (Int i = 0; i < N; i++) {
    cin >> a;
    cnt[a]++;
  }
  if (3 == cnt.size()) {
    if (N % 3) {
      cout << "No"
           << "\n";
      return 0;
    }
    vector<Int> temp;
    for (const auto& e : cnt) {
      if (e.second != N / 3) {
        cout << "No"
             << "\n";
        return 0;
      }
      temp.push_back(e.first);
    }
    if ((temp[0] ^ temp[1] == temp[2]) || (temp[0] ^ temp[2] == temp[1]) ||
        (temp[2] ^ temp[1] == temp[0])) {
      cout << "Yes"
           << "\n";
      return 0;
    } else {
      cout << "No"
           << "\n";
      return 0;
    }
  } else if (2 == cnt.size()) {
    if (N % 3) {
      cout << "No"
           << "\n";
      return 0;
    }
    vector<pair<Int, Int>> temp;
    for (const auto& e : cnt) {
      temp.push_back(make_pair(e.first, e.second));
    }
    sort(temp.begin(), temp.end());
    if (temp[0].first != 0) {
      cout << "No"
           << "\n";
      return 0;
    } else if (temp[0].second != N / 3) {
      cout << "No"
           << "\n";
      return 0;
    } else {
      cout << "Yes"
           << "\n";
      return 0;
    }
  } else if (1 == cnt.size()) {
    for (const auto& e : cnt) {
      if (0 != e.first) {
        cout << "No"
             << "\n";
        return 0;
      } else {
        cout << "Yes"
             << "\n";
        return 0;
      }
    }
  } else {
    cout << "No"
         << "\n";
    return 0;
  }
}
