#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL;
const int INF = 1000000007;
int N;
map<int, int> Mp;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N;
  int a;
  vector<int> vec;
  for (int i = 0; i < N; ++i) {
    cin >> a;
    if (Mp[a] == 0) vec.push_back(a);
    Mp[a] += 1;
  }
  if (vec.size() > 3) {
    cout << "No"
         << "\n";
    return 0;
  }
  if (vec.size() == 1) {
    if (vec[0] == 0)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
    return 0;
  }
  if (N % 3 != 0) {
    cout << "No"
         << "\n";
    return 0;
  }
  if (vec.size() == 2) {
    int a = vec[0];
    int b = vec[1];
    if (a != 0 && b != 0) {
      cout << "No"
           << "\n";
      return 0;
    }
    if (Mp[0] == 2 * N / 3)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
    return 0;
  }
  for (auto it = Mp.begin(); it != Mp.end(); ++it) {
    int cnt = it->second;
    if (cnt != N / 3) {
      cout << "No"
           << "\n";
      return 0;
    }
  }
  if ((vec[0] ^ vec[1] ^ vec[2]) == 0)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  return 0;
}
