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