#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::string printVector(const std::vector<T> &data) {
  std::stringstream ss;
  std::ostream_iterator<T> out_it(ss, ", ");
  ss << "[";
  std::copy(data.begin(), data.end() - 1, out_it);
  ss << data.back() << "]";
  return ss.str();
}
const int MOD = 1e9 + 7;
const long long LINF = 1001002003004005006ll;
const int INF = 1001001001;
signed main(int argc, char const *argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  map<int, int> mp;
  vector<long long> a(N), b(N);
  for (int i = (0); i < (N); ++i) {
    int tmp;
    cin >> tmp;
    a[i] = tmp;
    b[i] = tmp;
    mp[tmp]++;
  }
  sort(b.begin(), b.end());
  b.erase(unique(b.begin(), b.end()), b.end());
  if (N % 3 == 0) {
    int l = b.size();
    ;
    if (l > 3) {
      cout << "No" << endl;
      return 0;
    } else if (l == 3) {
      long long x, y, z;
      x = b[0];
      y = b[1];
      z = b[2];
      if ((x ^ y) == z) {
        if (mp[x] == mp[y] && mp[y] == mp[z]) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      } else {
        cout << "No" << endl;
      }
    } else if (l == 1) {
      if (b[0] == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      long long x, y;
      x = b[0];
      y = b[1];
      if (x == 0) {
        if (mp[y] == 2 * mp[x]) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      } else {
        cout << "No" << endl;
      }
    }
  } else {
    if (b[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
