#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  bool b = true;
  long long a[100000];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) b = false;
  }
  if (b) {
    cout << "Yes"
         << "\n";
    return 0;
  } else {
    if (n % 3 != 0) {
      cout << "No"
           << "\n";
      return 0;
    }
    sort(a, a + n);
    vector<pair<long long, long long> > num;
    num.push_back(make_pair(a[0], (long long)1));
    long long p = 0;
    for (long long i = 1; i < n; i++) {
      if (num[p].first == a[i]) {
        num[p].second++;
      } else {
        num.push_back(make_pair(a[i], (long long)1));
        p++;
      }
    }
    if (num.size() != 3) {
      cout << "No"
           << "\n";
    } else {
      if (num[0].second == num[1].second && num[1].second == num[2].second) {
        long long xo = num[0].first ^ num[1].first;
        xo ^= num[2].first;
        if (xo == 0) {
          cout << "Yes"
               << "\n";
        } else
          cout << "No"
               << "\n";
      } else
        cout << "No"
             << "\n";
    }
  }
  return 0;
}
