#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;
int n, a[maxn], cnt;
map<int, int> mp;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = (1); i <= (n); i++) {
    cin >> a[i];
    if (!mp[a[i]]) cnt++;
    mp[a[i]]++;
  }
  if (n % 3) {
    if (mp[0] == n)
      cout << "Yes";
    else
      cout << "No";
  } else {
    int cnt1 = mp[a[1]];
    if (cnt1 == n / 3) {
      for (int i = (2); i <= (n); i++) {
        int b = a[1] ^ a[i];
        if (mp[b] && mp[b] == cnt1 && cnt1 == mp[a[i]]) {
          cout << "Yes";
          return 0;
        }
      }
    } else if (cnt1 == n / 3 * 2) {
      if (mp[0] == n / 3) {
        cout << "Yes";
        return 0;
      }
    }
    cout << "No";
  }
  return 0;
}
