#include <bits/stdc++.h>
using namespace std;
constexpr int mod = 1000000007;
constexpr int mod1 = 998244353;
vector<int> dx = {0, -1, 0, 1}, dy = {1, 0, -1, 0};
bool inside(int y, int x, int h, int w) {
  if (y < h && y >= 0 && x < w && x >= 0) return true;
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); ++i) cin >> a.at(i);
  bool flg = true;
  for (int i = 0; i < (n); ++i)
    if (a.at(i) != 0) flg = false;
  if (flg) {
    cout << "Yes" << endl;
    return 0;
  }
  map<long long, long long> m;
  for (int i = 0; i < (n); ++i) m[a.at(i)]++;
  if (n % 3 == 0) {
    if (m.size() != 3) {
      cout << "No" << endl;
      return 0;
    }
    long long num = 0;
    for (auto i : m) {
      if (i.second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
      num ^= i.first;
    }
    if (num == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
}
