#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  map<int, int> cnt;
  vector<int> num;
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
    cnt[A[i]] += 1;
    if (cnt[A[i]] == 1) num.push_back(A[i]);
  }
  if (N % 3) {
    if (cnt[0] == N)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (num.size() > 3)
      cout << "No" << endl;
    else if (num.size() == 3) {
      if (cnt[num[0]] == N / 3 && cnt[num[1]] == N / 3 &&
          cnt[num[2]] == N / 3 && (num[0] ^ num[1] == num[2]))
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (num.size() == 2) {
      if (num[0] == 0 && cnt[num[1]] == 2 * cnt[num[0]])
        cout << "Yes" << endl;
      else if (num[1] == 0 && cnt[num[0]] == 2 * cnt[num[1]])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else {
      if (num[0] == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
