#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<long long, long long> A;
  for (int i = 0; i < (int)(N); i++) {
    int a;
    cin >> a;
    A[a] += 1;
  }
  if (A.size() > 3) {
    cout << "No" << endl;
  } else {
    vector<long long> num;
    vector<long long> fre;
    for (auto p : A) {
      num.push_back(p.first);
      fre.push_back(p.second);
    }
    if (num.size() == 3) {
      if (num[0] ^ num[1] ^ num[2] == 0 && fre[0] == fre[1] && fre[1] == fre[2])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
    if (num.size() == 2) {
      if (num[0] == 0 && fre[0] * 2 == fre[1])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
    if (num.size() == 1) {
      if (num[0] == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
