#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  bool all0 = true;
  long long a[N];
  map<int, int> mp;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    mp[a[i]]++;
    if (a[i] != 0) all0 = false;
  }
  if (all0) {
    cout << "Yes" << endl;
    return 0;
  }
  int sz = mp.size();
  if (N % 3 == 0) {
    if (sz == 3) {
      int num[3];
      int cnt[3];
      int i = 0;
      for (auto it = mp.begin(); it != mp.end(); it++) {
        num[i] = it->first;
        cnt[i] = it->second;
        i++;
      }
      if (cnt[0] == N / 3 && cnt[1] == N / 3 && cnt[2] == N / 3) {
        if ((num[0] ^ num[1]) == num[2]) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      } else {
        cout << "No" << endl;
      }
    } else if (sz == 2) {
      int num[2];
      int cnt[2];
      int i = 0;
      for (auto it = mp.begin(); it != mp.end(); it++) {
        num[i] = it->first;
        cnt[i] = it->second;
        i++;
      }
      if ((num[0] == 0 && cnt[0] == N * 2 / 3) ||
          (num[1] == 0 && cnt[1] == N * 2 / 3)) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
  return 0;
}
