#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const long long int LINF = 1LL * INF * INF;
const int MAXN = 2e5 + 10;
const int MAXM = 1e3 + 10;
priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;
vector<int> A;
vector<pair<int, int> > B;
char S[MAXN];
int main() {
  int n, m, k, a, b, x, y;
  int sum = 0;
  int cnt = 0;
  int mx = 0;
  int mn = INF;
  int cur = 0, idx = -1;
  int res = 0;
  cin >> n;
  A = vector<int>(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  sort(A.begin(), A.end());
  cur = A[0];
  cnt = 0;
  for (int i = 0; i < n; i++) {
    if (A[i] == cur)
      cnt++;
    else {
      B.push_back(pair<int, int>(cur, cnt));
      cur = A[i];
      cnt = 1;
    }
  }
  B.push_back(pair<int, int>(cur, cnt));
  int sz = B.size();
  if (sz >= 4) {
    cout << "No\n";
    return 0;
  } else if (sz == 3) {
    if ((B[0].first ^ B[1].first) != B[2].first)
      cout << "No\n";
    else {
      if (n % 3) cout << "No\n";
      for (int i = 0; i < 3; i++) {
        if (B[i].second != n / 3) {
          cout << "No\n";
          return 0;
        }
      }
      cout << "Yes\n";
      return 0;
    }
  } else if (sz == 2) {
    if (B[0].first)
      cout << "No\n";
    else {
      if (n % 3)
        cout << "No\n";
      else if (B[0].second != n / 3)
        cout << "No\n";
      else
        cout << "Yes\n";
    }
  } else {
    if (B[0].first)
      cout << "No\n";
    else
      cout << "Yes\n";
  }
  return 0;
}
