#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  vector<int> a(n);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i];
  bool flag = true;
  for (long long i = 0; i < (long long)(n); i++)
    if (a[i] != 0) flag = false;
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> itm;
  for (long long i = 0; i < (long long)(n); i++) itm[a[i]]++;
  if (((long long)(itm).size()) == 2) {
    if (itm[0] == 0) {
      cout << "No" << endl;
      return 0;
    } else if (itm[0] == n / 3) {
      cout << "Yes" << endl;
    }
  } else if (((long long)(itm).size()) == 3) {
    flag = true;
    vector<int> keys;
    for (auto now : itm) {
      keys.push_back(now.first);
      if (now.second != n / 3) flag = false;
    }
    if (!flag) {
      cout << "No" << endl;
      return 0;
    }
    if (keys[0] ^ keys[1] ^ keys[2] == 0) cout << "Yes" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
