#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  map<int, int> mp, mp2;
  for (int i = 0; i < n; i++) mp[a[i]]++;
  mp2 = mp;
  if (mp[0] == n) {
    cout << "Yes\n";
    return 0;
  }
  if (n % 3) {
    cout << "No\n";
    return 0;
  }
  if (mp.size() == 2) {
    if (!mp[0]) {
      cout << "No\n";
      return 0;
    }
    int num;
    for (auto x : mp)
      if (x.first) num = x.first;
    if (mp[num] == n / 3 * 2) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
    return 0;
  }
  if (mp2.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> use;
  for (auto x : mp2) {
    use.push_back(x.first);
  }
  if (use[0] ^ use[1] == use[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
