#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < (n); i++) {
    int x;
    cin >> x;
    if (m[x] == 0) m[x]++;
  }
  bool ans = false;
  if (m.size() == 1 && m.begin()->first == 0) ans = true;
  if (n % 3 != 0) {
    if (m.size() == 2) {
      for (auto kv : m) {
        if (kv.first == 0) {
          if (kv.second * 3 == n) ans = true;
        }
      }
    } else if (m.size() == 3) {
      vector<int> k;
      vector<int> v;
      for (auto kv : m) {
        k.emplace_back(kv.first);
        v.emplace_back(kv.second);
      }
      if (v[0] == v[1] && v[1] == v[2]) {
        if (v[2] ^ v[1] == v[0]) ans = true;
        if (v[2] ^ v[1] == v[1]) ans = true;
        if (v[0] ^ v[1] == v[2]) ans = true;
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
