#include <bits/stdc++.h>
using namespace std;
bool all_zero(vector<int> V) {
  bool flag = true;
  for (int i = 1; i < V.size(); i++) {
    if (V[0] == 0) {
      if (V[i - 1] != V[i]) flag = false;
    } else {
      flag = false;
    }
  }
  return flag;
}
int main() {
  int n;
  cin >> n;
  vector<int> V(n);
  for (int i = 0; i < n; i++) cin >> V[i];
  bool ans = true;
  if (all_zero(V)) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> S;
  int cnt = 0;
  sort(V.begin(), V.end());
  S.push_back(V[0]);
  for (int i = 1; i < n; i++) {
    if (V[i - 1] != V[i]) {
      cnt++;
      S.push_back(V[i]);
    }
  }
  if (cnt == 2) {
    if ((S[0] ^ S[1] ^ S[2]) != 0) {
      ans = false;
    } else {
      int s1 = 0, s2 = 0, s3 = 0;
      for (int i = 0; i < n; i++) {
        if (S[0] == V[i]) s1++;
        if (S[1] == V[i]) s2++;
        if (S[2] == V[i]) s3++;
      }
      if (s1 != s2 || s2 != s3) ans = false;
    }
  } else if (cnt == 1) {
    ans = false;
  } else {
    ans = false;
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
