#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int x1, x2, x3;
  x1 = a[0];
  for (int i = 1; i < n; i++) {
    if (a[i] != x1) {
      x2 = a[i];
      break;
    }
  }
  for (int i = 0; i < n; i++) {
    if ((a[i] != x1) && (a[i] != x2)) {
      x3 = a[i];
      break;
    }
  }
  int c1 = 0;
  int c2 = 0;
  int c3 = 0;
  int f = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == x1) {
      c1++;
    } else if (a[i] == x2) {
      c2++;
    } else if (a[i] == x3) {
      c3++;
    } else {
      f = 1;
    }
  }
  if (((x1 ^ x2) == x3) && ((x2 ^ x3) == x1) && ((x3 ^ x1) == x2)) {
    if ((c1 == c2) && (c2 == c3) && (c3 == c1) && (f == 0)) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
