#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const ll inf = 1ll << 29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  int N;
  cin >> N;
  vi a(N);
  for (int i = 0; i < (N); i++) cin >> a.at(i);
  if (N % 3 != 0) {
    for (int i = 0; i < (N); i++) {
      if (a.at(i) != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  } else {
    sort((a).begin(), (a).end());
    ;
    int cnt1 = count((a).begin(), (a).end(), a.at(0));
    int cnt2 = count((a).begin(), (a).end(), a.at(N / 3));
    int cnt3 = count((a).begin(), (a).end(), a.at(2 * N / 3));
    if (a.at(0) == 0 && a.at(N / 3) == a.at(2 * N / 3) && cnt1 == N / 3 &&
        cnt2 == N / 3 && cnt2 == cnt3) {
      cout << "Yes" << endl;
      return 0;
    } else if ((a.at(0) ^ a.at(N / 3) ^ a.at(2 * N / 3)) == 0 &&
               cnt1 == N / 3 && cnt1 == cnt2 && cnt2 == cnt3) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
}
