#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const double PI = 3.14159265358979323846;
int mod = 1e9 + 7;
int INF = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  for (ll i = 0; i < (N); ++i) {
    int tmp;
    cin >> tmp;
    mp[tmp]++;
  }
  if (int(mp.size()) >= 4) {
    cout << "No" << endl;
    return 0;
  }
  if (int(mp.size()) == 1) {
    for (P p : mp) {
      if (p.first == 0) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  vector<P> vect;
  for (P p : mp) {
    vect.emplace_back(p);
  }
  if (int(vect.size()) == 2) {
    if (vect[0].second * 2 == vect[1].second ||
        vect[0].second == vect[1].second * 2) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (int(vect.size()) == 3) {
    if (vect[0].second == vect[1].second && vect[1].second == vect[2].second) {
      if (vect[0].first ^ vect[1].first == vect[2].first ||
          vect[0].first ^ vect[2].first == vect[1].first) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  return 0;
}
