#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int temp = -1;
  int a[10000];
  vector<int> Num;
  int tomany = 0;
  int count1 = 0;
  int count2 = 0;
  int count3 = 0;
  int count = 0;
  int b = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (a[i] != temp) {
      Num.push_back(a[i]);
      count++;
      if (count == 2) {
        b = a[i] ^ temp;
        Num.push_back(b);
        count++;
      } else if (count > 3) {
        tomany = 1;
      }
    }
    temp = a[i];
  }
  for (int i = 0; i < N; i++) {
    if (a[i] == Num[0]) {
      count1++;
    } else if (a[i] == Num[1]) {
      count2++;
    } else if (a[i] == Num[2]) {
      count3++;
    }
  }
  if (count1 == count2 == count3) {
    cout << "Yes" << endl;
  } else if (tomany == 1) {
    cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
