#include <bits/stdc++.h>
using namespace std;
int n, tp;
map<int, int> mp;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> tp;
    mp[tp]++;
  }
  if (mp.size() == 1) {
    if (mp[0]) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  } else if (n % 3 == 0) {
    if (mp.size() == 3) {
      int to = 0, xx = 0;
      for (auto x : mp) {
        to += (x.second == n / 3);
        xx ^= x.first;
      }
      if (to == 3 && xx == 0) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    } else {
      cout << "No\n";
    }
  } else {
    cout << "No\n";
  }
  return 0;
}
