#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 2147483647;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> mp;
  for (int i = 0; i < int(n); ++i) {
    int input;
    cin >> input;
    mp[input]++;
  }
  if (mp.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 1 && mp[0] > 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 2 && mp[0] == n / 3) {
    cout << "Yes" << endl;
  }
  if (mp.size() == 3) {
    vector<int> b(3);
    vector<int> c(3);
    int i = 0;
    for (auto a : mp) {
      b[i] = a.first;
      c[i] = a.second;
      i++;
    }
    if (c[0] == c[1] || c[0] == c[2]) {
      int x;
      int y;
      x = b[0] ^ b[1];
      y = x ^ b[2];
      if (y == 0) cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}
