#include <bits/stdc++.h>
using namespace std;
int n;
map<long long, long long> ree;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (long long i = 0; i < (signed)(n); i++) {
    long long x;
    cin >> x;
    ree[x]++;
  }
  if (ree.size() > 3) {
    cout << "No\n";
  } else if (ree.size() == 3) {
    pair<long long, long long> a = *ree.begin(), b = *(++ree.begin()),
                               c = *(++(++ree.begin()));
    if (a.second == b.second && a.second == c.second &&
        a.first ^ b.first ^ c.first == 0) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  } else if (ree.size() == 2) {
    pair<long long, long long> a = *ree.begin(), b = *(++ree.begin());
    if (a.first == 0 && b.second == 2 * a.second) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  } else {
    if (ree.begin()->first == 0) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
  return 0;
}
