#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  return b ? gcd(b, a % b) : a;
}
long long int lcm(long long int a, long long int b) {
  return a / gcd(a, b) * b;
}
long long int MOD = 1000000007;
int main() {
  long long int N;
  cin >> N;
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<long long int, long long int> m;
  for (int i = 0; i < (int)(N); i++) {
    long long int a;
    cin >> a;
    m[a]++;
  }
  bool flag = m.size() == 1 && m[0] == N;
  flag |= m.size() == 2 && m[0] == N / 3;
  long long int sum = 0;
  for (pair<long long int, long long int> t : m) sum ^= t.first;
  flag |= m.size() == 3 && sum == 0;
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
