#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, b[1000000010];
  cin >> n;
  long long a[n];
  vector<long long> abc;
  if (n != 3 && n % 2 == 1) {
    cout << "No" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    b[a[i]]++;
  }
  int count = 0;
  for (long long i = 0; i <= 1000000000; i++) {
    if (b[i] > 0) {
      count++;
      abc.push_back(b[i]);
    }
    if (count > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (count < 3) {
    cout << "No" << endl;
    return 0;
  }
  if (abc[0] ^ abc[1] != abc[2]) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
