#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF * INF * 10;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vi a(n);
  bool zero = true;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (a[i]) zero = false;
  }
  if (zero) {
    cout << "Yes" << endl;
    return 0;
  }
  vi vec(4, -1);
  vi cou(4);
  for (int i = 0; i < n; ++i) {
    int h = -1;
    int hh = -1;
    for (int j = 0; j < 3; ++j) {
      if (vec[j + 1] == a[i]) {
        h = j + 1;
        break;
      }
      if (vec[j + 1] == -1) {
        hh = j + 1;
        break;
      }
    }
    if (h == -1) {
      if (cou[3]) {
        cout << "No" << endl;
        return 0;
      }
      vec[hh] = a[i];
      cou[hh]++;
    } else {
      cou[h]++;
    }
  }
  auto no = []() { cout << "No" << endl; };
  if (!cou[3]) {
    no();
    return 0;
  }
  int h = 0;
  for (int i = 0; i < 3; ++i) {
    h ^= vec[i + 1];
  }
  if (h or n % 3) {
    no();
    return 0;
  }
  h = n / 3;
  for (int i = 0; i < 3; ++i) {
    if (cou[i + 1] != h) {
      no();
      return 0;
    }
  }
  cout << "Yes" << endl;
}
