#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; ++i) cin >> a[i];
  int judge = 1;
  if (n == 3) {
    if (!(a[0] == (a[1] ^ a[2]) && a[1] == (a[2] ^ a[0]) &&
          a[2] == (a[0] ^ a[1])))
      judge = 0;
  } else if (n % 3) {
    for (int i = 0; i < n - 1; ++i) {
      if (a[i] != a[i + 1]) {
        judge = 0;
        break;
      }
    }
  } else {
    map<long long, int> m;
    for (int i = 0; i < n; ++i) m[a[i]]++;
    for (int i = 0; i < n; ++i)
      if (m[a[i]] % (n / 3) != 0) judge = 0;
  }
  if (judge)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
