#include <bits/stdc++.h>
using namespace std;
const long long MAX = 510000;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
template <class T>
inline bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  map<long long, int> m;
  set<int> s;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    m[a[i]]++;
    s.insert(a[i]);
  }
  auto itr = s.begin();
  if (m.size() == 1 && a[0] == 0) {
    cout << "Yes" << endl;
  } else if (n % 3 == 0 && m.size() == 3) {
    int x = *itr;
    int a = m[*itr];
    itr++;
    int y = *itr;
    int b = m[*itr];
    itr++;
    int z = *itr;
    int c = m[*itr];
    if (a == b && b == c && x ^ y == z) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (n % 2 == 0 && m.size() == 2) {
    int x = *itr;
    int a = m[*itr];
    itr++;
    int y = *itr;
    int b = m[*itr];
    if (a == b && x * y == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
