#include <bits/stdc++.h>
using namespace std;
map<long long int, long long int> cnt;
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  set<long long int> s;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
    cnt[a[i]]++;
  }
  if (n % 3 == 0) {
    if (s.size() == 3) {
      long long int e[3];
      long long int i = 0;
      for (long long int x : s) e[i++] = x;
      if (cnt[e[0]] == n / 3 && cnt[e[1]] == n / 3 && cnt[e[2]] == n / 3 &&
          e[1] ^ e[2] == e[0]) {
        cout << "Yes\n";
        return;
      }
    } else if (s.size() == 2) {
      long long int e[2];
      long long int i = 0;
      for (long long int x : s) e[i++] = x;
      if (e[0] == 0 && cnt[0] == n / 3) {
        cout << "Yes\n";
        return;
      }
    }
  }
  if (n % 2 == 0) {
    if (s.size() == 2) {
      long long int e[2];
      long long int i = 0;
      for (long long int x : s) e[i++] = x;
      if (cnt[e[0]] == n / 2 && cnt[e[1]] == n / 2) {
        cout << "Yes\n";
        return;
      }
    }
  }
  if (s.size() == 1) {
    cout << "Yes\n";
    return;
  }
  cout << "No\n";
}
int main() {
  int T = 1;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (T--) solve();
  return 0;
}
