#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using Pll_ll = pair<ll, ll>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;
const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;
const double EPS = 1E-10;
template <class T, class S>
bool chmax(T &a, const S &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class S>
bool chmin(T &a, const S &b) {
  if (b < a) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  VI a(N);
  for (int i = (0), i_len = (N); i < i_len; ++i) {
    int a;
    cin >> a;
    ++mp[a];
  }
  if (mp.size() == 1) {
    cout << (mp[0] ? "Yes" : "No") << endl;
    return 0;
  }
  if (N % 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 2) {
    int a((mp.begin())->first);
    if (a) {
      cout << "No" << endl;
      return 0;
    }
    cout << (((mp.begin())->second == N / 3 * 2) ? "Yes" : "No") << endl;
    return 0;
  }
  if (mp.size() == 3) {
    int i(0);
    VI a(3);
    for (auto itr = (mp).begin(); itr != (mp).end(); ++itr) {
      if (itr->second != N / 3) {
        cout << "No" << endl;
        return 0;
      }
      a[i] = itr->first;
      ++i;
    }
    cout << ((a[0] ^ a[1] ^ a[2]) ? "No" : "Yes") << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
