#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int N;
  unsigned int a[2], b[2], c[2];
  bool ans = true;
  cin >> N;
  a[1] = 0;
  b[1] = 0;
  c[1] = 0;
  a[0] = ~0;
  b[0] = ~0;
  c[0] = ~0;
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    if (a[0] == x)
      a[1]++;
    else if (b[0] == x)
      b[1]++;
    else if (c[0] == x)
      c[1]++;
    else {
      if (a[0] == ~0) {
        a[0] = x;
        a[1]++;
      } else if (b[0] == ~0) {
        b[0] = x;
        b[1]++;
      } else if (c[0] == ~0) {
        c[0] = x;
        c[1]++;
      } else {
        ans = false;
      }
    }
  }
  if (ans && a[1] == b[1] && b[1] == c[1] && ((a[0] ^ c[0]) == b[0])) {
    cout << "Yes" << endl;
  } else if (ans && a[1] == b[1] && c[1] == 0 && (a[0] ^ a[0]) == b[0]) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
