#include <bits/stdc++.h>
using namespace std;
vector<long long> a;
long long b[3];
int main() {
  long long n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  long long s1 = a[0], s2 = a[n - 1];
  long long s3 = s1 ^ s2;
  if (s1 == 0 && s2 == 0) {
    cout << "Yes";
    return 0;
  }
  for (int i = 0; i < n; i++) {
    long long now = a[i];
    if (now == s1) {
      b[0]++;
    }
    if (now == s2) {
      b[1]++;
    }
    if (now == s3) {
      b[2]++;
    }
  }
  if (b[0] * 3 == n && b[1] * 3 == n && b[2] * 3 == n) {
    cout << "Yes";
    return 0;
  }
  cout << "No";
  return 0;
}
