#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
const int inf = INT_MAX;
const long long inff = 1e18;
const long long mod = 1e9 + 7;
int n;
vector<int> v, u;
int x;
int cnt[5];
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> x;
    v.push_back(x);
    u.push_back(x);
  }
  sort((v).begin(), (v).end());
  int N = unique((v).begin(), (v).end()) - v.begin();
  if (n % 3 != 0) return cout << "No" << endl, 0;
  if (N > 3) return cout << "No" << endl, 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < n; j++) {
      if (u[j] == v[i]) cnt[i]++;
    }
  }
  if (N == 1 && v[0] == 0) return cout << "Yes" << endl, 0;
  if (N == 2 && v[0] == 0 && cnt[0] == n / 3) return cout << "Yes" << endl, 0;
  if (N == 3 && v[0] == (v[1] ^ v[2]) && cnt[0] == cnt[1] && cnt[1] == cnt[2])
    return cout << "Yes" << endl, 0;
  cout << "No" << endl;
}
