#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const long long LINF = 1LL << 60;
const int INF = 1 << 30;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> ma;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    ma[a[i]]++;
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  bool f = true;
  if (a.size() == 1) {
    if (a[0] != 0) {
      f = false;
    }
  } else if (a.size() == 2) {
    if (ma[0] != 2 * ma[a[1]]) {
      f = false;
    }
  } else if (a.size() == 3) {
    if ((a[0] ^ a[1] ^ a[2]) != 0) f = false;
    if (ma[a[0]] != ma[a[1]] || ma[a[0]] != ma[a[2]]) f = false;
  } else {
    f = false;
  }
  cout << (f ? "Yes" : "No") << endl;
  return 0;
}
