#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> V(n);
  for (int i = 0; i < n; i++) cin >> V[i];
  bool flag = true;
  if (n % 3 == 0) {
    sort(V.begin(), V.end());
    int cnt = 0;
    int a;
    bool t = true;
    for (int i = 1; i < n; i++) {
      if (V[i - 1] != V[i]) {
        cnt++;
        if (t) {
          a = V[i];
          t = false;
        }
      }
    }
    if (cnt == 2 && ((V[0] ^ a) ^ *(V.end() - 1)) == 0)
      ;
    else
      flag = false;
  } else {
    if (V[0] != 0) flag = false;
    for (int i = 1; i < n; i++) {
      if (V[i - 1] != V[i]) flag = false;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
