#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  };
  map<long long int, long long int> m;
  for (long long int i = 0; i < n; i++) {
    m[a[i]]++;
  }
  long long int cnt = 0;
  long long int num = m[a[0]];
  for (auto it = m.begin(); it != m.end(); it++) {
    cnt++;
    if (it->second != num) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (cnt != 3) {
    cout << "No" << endl;
    return 0;
  }
  long long int x[3];
  long long int ind = 0;
  for (auto it = m.begin(); it != m.end(); it++) {
    x[ind] = it->first;
    ind++;
  }
  if (((x[0] ^ x[1]) == x[2]) && ((x[1] ^ x[2]) == x[0]) &&
      ((x[2] ^ x[0]) == x[1])) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
