#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  map<int, int> cnt;
  for (int i = (0); i < (int)(N); i++) {
    int a;
    cin >> a;
    cnt[a]++;
  }
  if (N % 3 == 0) {
    if (cnt.size() == 1) {
      if (cnt[0] == N)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (cnt.size() == 2) {
      vector<pair<int, int>> v;
      for (__typeof((cnt).begin()) it = (cnt).begin(); it != (cnt).end(); ++it)
        v.emplace_back(*it);
      if (v[0].first == 0 && v[0].second == N / 3)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (cnt.size() == 3) {
      vector<pair<int, int>> v;
      for (__typeof((cnt).begin()) it = (cnt).begin(); it != (cnt).end(); ++it)
        v.emplace_back(*it);
      if (v[0].second == v[1].second && v[1].second == v[2].second) {
        int x = v[0].first;
        int y = v[1].first;
        int z = v[2].first;
        if (x ^ y == z || x ^ z == y || y ^ z == x)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else {
        cout << "No" << endl;
      }
    } else
      cout << "No" << endl;
  } else {
    if (cnt[0] == N)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
