#include <bits/stdc++.h>
using namespace std;
int a[100001];
int main() {
  int N;
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  int x0 = 0, x1 = 0, x2 = 0, x3 = 0;
  int i0 = 0, i1 = 0, i2 = 0, i3 = 0;
  for (int i = 0; i < N; i++) {
    if (a[i] == 0) {
      i0++;
    } else if (i1 == 0) {
      x1 = a[i];
      i1++;
    } else if (a[i] == x1) {
      i1++;
    } else if (i2 == 0) {
      x2 = a[i];
      i2++;
    } else if (a[i] == x2) {
      i2++;
    } else if (i3 == 0) {
      x3 = a[i];
      i3++;
    } else if (a[i] == x3) {
      i3++;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (i0 == N) {
    cout << "Yes" << endl;
    return 0;
  } else if ((i0 * 3 == N) && (i1 * 3 == 2 * N)) {
    cout << "Yes" << endl;
    return 0;
  } else if ((i1 * 3 == N) && (i2 * 3 == N) && (i3 * 3 == N) &&
             (x1 ^ x2 ^ x3 == 0)) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
  return 0;
}
