#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> vec(n);
  for (long long i = 0; i < n; i++) cin >> vec[i];
  long long s = vec.size();
  long long k = s / 3;
  if (s % 3 != 0)
    cout << "No" << endl;
  else if (n == 3) {
    long long sum = vec[0] ^ vec[1] ^ vec[2];
    if (sum == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    long long j = 0;
    bool a = true;
    while (j <= n - k) {
      bool b = true;
      for (long long i = 1; i < k; i++) {
        if (vec[j] != vec[j + i]) {
          b = false;
          break;
        }
      }
      if (!b) {
        a = false;
        break;
      } else {
        j += k;
      }
    }
    if (a) {
      long long sum2 = vec[0] ^ vec[k] ^ vec[2 * k];
      if (sum2 == 0) {
        cout << "Yes" << endl;
      } else
        cout << "No" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
