#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const long long linf = 1LL << 50;
const double eps = 1e-10;
const int mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < ((int)n); i++) cin >> a[i];
  vector<long long> b = a;
  sort(a.begin(), a.end());
  decltype(a)::iterator result = unique(a.begin(), a.end());
  a.erase(result, a.end());
  if (a.size() == 1 && a[0] == 0)
    cout << "Yes" << endl;
  else if (n % 3 != 0)
    cout << "No" << endl;
  else if (a.size() == 3 && a[0] ^ a[1] == a[2])
    cout << "Yes" << endl;
  else if (a.size() == 2 && a[0] == 0 &&
           accumulate(b.begin(), b.end(), 0LL) == a[1] * n / 3 * 2)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
