#include <bits/stdc++.h>
using namespace std;
const int INF = 1000 * 1000 * 1000 + 7;
const long long LINF = 1LL * INF * INF;
const int MAX = 1e6 + 7;
const double PI = acos(-1.);
const double EPS = 1e-7;
const int MAXN = 100005;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
set<int> x[100005];
int cnt[100005];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mep;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
    mep[a[i]]++;
  }
  sort(a.begin(), a.end());
  if (((int)mep.size()) > 3) {
    cout << "No\n";
    return 0;
  }
  if (n % 3 != 0) {
    if (a[0] == a[n - 1] && a[n - 1] == 0) {
      cout << "Yes\n";
      return 0;
    }
    if (a[0] == 0 && a[n / 3] == a[n - 1] && a[0] == a[n / 3 - 1]) {
      cout << "Yes\n";
      return 0;
    }
  }
  if (a[0] == a[n - 1] && a[n - 1] == 0) {
    cout << "Yes\n";
    return 0;
  }
  if (a[0] ^ a[n / 3] ^ a[2 * n / 3] == 0) {
    cout << "Yes\n";
    return 0;
  }
  if (a[0] == 0 && a[n / 3] == a[n - 1] && a[0] == a[n / 3 - 1]) {
    cout << "Yes\n";
    return 0;
  }
  cout << "No\n";
  return 0;
}
