#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main() {
  int N;
  cin >> N;
  vector<long long> A(N);
  vector<long long> ans(0);
  map<int, int> B;
  for (int i = 0; i < (int)(N); i++) {
    long long num;
    cin >> num;
    A.at(i) = num;
    B[num]++;
    bool t = false;
    for (int j = 0; j < (int)(ans.size()); j++) {
      if (num == ans.at(j)) {
        t = true;
      }
    }
    if (t) continue;
    ans.push_back(num);
    if (3 < ans.size()) {
      cout << "No" << endl;
      return 0;
    }
  }
  bool allive0 = false;
  for (int i = 0; i < (int)(ans.size()); i++) {
    if (ans.at(i) == 0) {
      allive0 = true;
    }
  }
  if (allive0) {
    if (ans.size() != 2) {
      cout << "No" << endl;
      return 0;
    }
    for (int i = 0; i < (int)(ans.size()); i++) {
      if (B[ans.at(i)] != N / 2) {
        cout << "No" << endl;
        return 0;
      }
    }
  } else {
    if (ans.size() == 3) {
      int al = ans.at(0) ^ ans.at(1) ^ ans.at(2);
      if (al != 0) {
        cout << "No" << endl;
        return 0;
      }
      for (int i = 0; i < (int)(ans.size()); i++) {
        if (B[ans.at(i)] != N / 3) {
          cout << "No" << endl;
          return 0;
        }
      }
    } else if (ans.size() == 2) {
      cout << "No" << endl;
      return 0;
    } else {
      if (B[ans.at(0)] != 2 * N / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" << endl;
}
