#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  map<int, int> m;
  for (int i = (0); i < (N); ++i) {
    int a;
    cin >> a;
    ++m[a];
  }
  if (N % 3) {
    if (m[0] == N) {
      cout << "Yes\n";
      return 0;
    }
  } else {
    if ((m.size() == 2 && m[0] == N / 3) || m[0] == N) {
      cout << "Yes\n";
      return 0;
    }
    m.erase(0);
    if (m.size() == 3) {
      pair<int64_t, int64_t> m1 = *m.begin(), m2 = *++m.begin(),
                             m3 = *(m.end());
      if (m1.first ^ m2.first ^ m3.first == 0 && m1.second == N / 3 &&
          m2.second == N / 3) {
        cout << "Yes\n";
        return 0;
      }
    }
  }
  cout << "No\n";
}
