#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  int xor_all = 0;
  map<int, int> m;
  int nums = 0;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    if (m[a] == 0) {
      nums++;
    }
    m[a]++;
    xor_all ^= a;
  }
  if (n == 3) {
    if (xor_all == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (m[0] == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 == 0) {
    vector<int> num;
    for (auto it = m.begin(); it != m.end(); it++) {
      num.push_back(it->first);
    }
    if (nums == 1) {
      cout << "No" << endl;
    } else if (nums == 2) {
      if (m[0] == n / 3) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (nums == 3) {
      if ((num[0] == (num[1] ^ num[2])) && (num[1] == (num[0] ^ num[2])) &&
          (num[2] == (num[1] ^ num[0]))) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  } else if (n % 3 == 1) {
    cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
