#include <bits/stdc++.h>
using namespace std;
const string yes = "Yes";
const string no = "No";
map<int, int> cnt;
set<int> has;
int num[3];
int main() {
  int N;
  ios::sync_with_stdio(false);
  cin >> N;
  int a;
  for (int i = 0; i < N; ++i) {
    cin >> a;
    has.insert(a);
    if (cnt.count(a) == 0) cnt[a] = 0;
    cnt[a]++;
  }
  if (has.size() == 1)
    if (*has.begin() == 0)
      cout << yes << endl;
    else
      cout << no << endl;
  if (N % 3 != 0) {
    cout << no << endl;
    return 0;
  }
  if (has.size() > 3) {
    cout << no << endl;
    return 0;
  }
  if (has.size() == 3) {
    int dd = 0;
    for (auto x : has) num[dd++] = x;
    int A, B, C;
    A = num[0];
    B = num[1];
    C = num[2];
    if (cnt[A] != cnt[B] || cnt[B] != cnt[C]) {
      cout << no << endl;
      return 0;
    }
    if (A ^ B != C) {
      cout << no << endl;
      return 0;
    }
    cout << yes << endl;
    return 0;
  }
  if (has.size() == 2) {
    int A, B;
    A = *has.begin();
    B = *has.rbegin();
    if (A > B) swap(A, B);
    if (A != 0 || cnt[A] * 2 != cnt[B]) {
      cout << no << endl;
    } else
      cout << yes << endl;
    return 0;
  }
  return 0;
}
