#include <bits/stdc++.h>
using namespace std;
const long long int INF = 99999999999999;
const long long int mod = 1000000007;
long long int n, m, k, sum = 0, res = 0, a[200005] = {}, ruiseki[200005] = {},
                       xornum[50] = {}, one = -1, two = -1, three = -1,
                       cou[4] = {};
int main() {
  map<long long int, long long int> mp;
  cout << fixed << setprecision(10);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (one == a[i]) {
      cou[1]++;
    } else if (two == a[i]) {
      cou[2]++;
    } else if (three == a[i]) {
      cou[3]++;
    }
    if (one == -1) {
      one = a[i];
      cou[1] = 1;
    }
    if (one != -1 && one != a[i] && two == -1) {
      two = a[i];
      cou[2] = 1;
    }
    if (one != -1 && one != a[i] && two != a[i] && two != -1 && three == -1) {
      three = a[i];
      cou[3] = 1;
    }
    if (one != -1 && two != -1 && three != -1 && one != a[i] && two != a[i] &&
        three != a[i]) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (cou[1] == n && one == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if ((cou[1] == 2 * cou[2] && one == 0 || cou[2] == 2 * cou[1] && two == 0) &&
      cou[3] == 0) {
    cout << "No" << endl;
    return 0;
  }
  if (cou[1] == cou[2] && cou[2] == cou[3] && (one ^ two) == three) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
}
