#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  if (n == 3) {
    if (a[0] ^ a[1] == a[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  map<int, int> c;
  for (int i = 0; i < n; ++i) {
    ++c[a[i]];
  }
  if (n % 3 != 0) {
    if (c[0] == n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (c.size() == 3) {
    auto tmp = 0;
    for (auto it : c) {
      tmp ^= it.first;
      if (it.second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (tmp != 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  } else if (c.size() == 1) {
    if (c[0] != n) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (c.size() != 2) {
    cout << "No" << endl;
  } else {
    if (c[0] == n / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
