#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const int MAX = 510000;
const long long MOD = 1000000007;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  set<long long> s;
  for (long long i = (0); i < (n); ++i) {
    cin >> a[i];
    s.insert(a[i]);
  }
  if (n % 3 || s.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (s.size() == 3) {
    vector<long long> b(3);
    auto it = s.begin();
    for (long long i = (0); i < (3); ++i) {
      b[i] = *it;
      it++;
    }
    long long x = b[0] ^ b[1] ^ b[2];
    if (x != 0) {
      cout << "No" << endl;
      return 0;
    }
    vector<long long> c(3, 0);
    for (long long i = (0); i < (n); ++i) {
      for (long long j = (0); j < (3); ++j) {
        if (a[i] == b[j]) c[j]++;
      }
    }
    if (!(c[0] == c[1] && c[1] == c[2])) {
      cout << "No" << endl;
      return 0;
    }
  } else if (s.size() == 2) {
    auto it = s.begin();
    if (*it != 0) {
      cout << "No" << endl;
      return 0;
    }
    long long x = 0;
    for (long long i = (0); i < (n); ++i) {
      if (a[i] == 0) x++;
    }
    if (x != n / 3) {
      cout << "No" << endl;
      return 0;
    }
  } else {
    if (*(s.begin()) != 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}
