#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int b = 1;
  if (n % 3 != 0) b = 0;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    mp[a[i]]++;
  }
  int g = 1, h = 0;
  for (auto &p : mp) {
    if (p.second != n / 3) g = 0;
    h ^= p.first;
  }
  if (g) {
    if (h != 0) b = 0;
  } else {
    b = 0;
  }
  int f = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] != 0) f = 0;
  }
  if (f) b = 1;
  cout << (b ? "Yes" : "No") << endl;
  return 0;
}
