#include <bits/stdc++.h>
using namespace std;
const int bigmod = 1000000007;
const int INF = 1050000000;
const long long INFll = 100000000000000000;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int(i) = 0; (i) < (N); (i)++) cin >> a[i];
  map<int, int> check_is2;
  for (int(i) = 0; (i) < (N); (i)++) check_is2[a[i]]++;
  if (check_is2.size() == 1) {
    if (a[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (check_is2.size() == 2) {
    if (N % 3 == 0 && check_is2[0] == N / 3) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (check_is2.size() == 3) {
    vector<int> val(3);
    int i = 0;
    for (auto e : check_is2) {
      val[i] = e.first;
      i++;
    }
    if ((val[0] ^ val[1]) == val[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
