#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N;
  cin >> N;
  long long ans = 0;
  vector<long long> data(N);
  long long a, b, c;
  long long acnt, bcnt, ccnt;
  a = -1;
  b = -1;
  c = -1;
  acnt = 0;
  bcnt = 0;
  ccnt = 0;
  for (int(i) = int(0); (i) < int(N); (i)++) {
    long long buf;
    cin >> buf;
    if (a == -1) {
      a = buf;
      acnt++;
    } else if (a == buf) {
      acnt++;
    } else if (b == -1) {
      b = buf;
      bcnt++;
    } else if (b == buf) {
      bcnt++;
    } else if (c == -1) {
      c = buf;
      ccnt++;
    } else if (c == buf) {
      ccnt++;
    } else {
      cout << ("No") << endl;
      return 0;
    }
  }
  if (((a ^ b) == c) && (acnt == bcnt) && (ccnt == bcnt)) {
    cout << ("Yes") << endl;
  } else {
    cout << ("No") << endl;
  }
  return 0;
}
