#include <bits/stdc++.h>
using namespace std;
inline int in() {
  int x;
  scanf("%d", &x);
  return x;
}
const long long int LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
int main() {
  int N;
  cin >> N;
  map<int, int> mp;
  for (int i = 0; i < (N); ++i) {
    int x;
    cin >> x;
    mp[x]++;
  }
  int len = (int)(mp).size();
  if (len == 1) {
    auto a = mp.begin();
    if (a->first == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (len == 2) {
    auto a = mp.begin();
    auto b = mp.begin();
    b++;
    if (a->first == 0 && a->second == 2 * b->second) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (len == 3) {
    auto a = mp.begin();
    auto b = mp.begin();
    b++;
    auto c = mp.begin();
    c++;
    c++;
    if (a->first ^ b->first ^ c->first == 0 && a->second == b->second &&
        b->second == c->second) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
