#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = INF * (long long)INF;
const int MAX = 4007;
const int MOD = 998244353;
int main(int argc, char* argv[]) {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = (0); i < (n); i++) {
    cin >> A[i];
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  sort(A.begin(), A.end());
  if (A[0] != A[n / 3 - 1] || A[n / 3] != A[2 * n / 3 - 1] ||
      A[2 * n / 3] != A[n - 1]) {
    cout << "No" << endl;
    return 0;
  }
  if ((A[0] ^ A[n / 3] ^ A[2 * n / 3]) != 0) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
}
