#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  int N;
  scanf("%d", &N);
  int a[N];
  set<int> s;
  map<int, int> m;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a[i]);
    s.insert(a[i]);
    ++m[a[i]];
  }
  if (int((s).size()) > 3)
    cout << "No" << endl;
  else if (int((s).size()) == 3) {
    int x, y, z;
    auto pos = s.begin();
    x = *pos;
    ++pos;
    y = *pos;
    ++pos;
    z = *pos;
    int ans = ((x ^ y) ^ z);
    if (ans == 0 && m[x] == N / 3 && N % 3 == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (int((s).size()) == 2) {
    int x, y;
    auto pos = s.begin();
    x = *pos;
    ++pos;
    y = *pos;
    int max_num = max(x, y);
    int min_num = min(x, y);
    x = max_num;
    y = min_num;
    if (y == 0 && m[x] == N * 2 / 3 && N % 3 == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (a[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
