#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  cin.tie(0);
  cin.sync_with_stdio(false);
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  bool flag = false;
  if (mp.size() == 1) {
    auto iter = mp.begin();
    if (iter->first == 0) {
      flag = true;
    }
  } else if (mp.size() == 2) {
    if (N % 3 == 0) {
      auto iter = mp.begin();
      int num = iter->second;
      if (num == N / 3 && iter->first == 0) {
        flag = true;
      }
    }
  } else if (mp.size() == 3) {
    vector<int> vec(3);
    if (N % 3 == 0) {
      auto iter = mp.begin();
      int cnt = 0;
      for (int i = 0; i < 3; i++) {
        int num = iter->second;
        vec.push_back(iter->first);
        if (num == N / 3) {
          cnt++;
        }
        iter++;
      }
      if (cnt >= 3) {
        flag = true;
      }
    }
    if (vec[0] ^ vec[1] ^ vec[2] != 0) {
      flag = false;
    }
  }
  if (flag) {
    cout << "Yes"
         << "\n";
  } else {
    cout << "No"
         << "\n";
  }
}
