#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> camels(n);
  set<long long> xo;
  for (int i = 0; i < n; i++) {
    long long j;
    cin >> j;
    camels[i] = j;
    xo.insert(j);
  }
  bool b = true;
  sort(camels.begin(), camels.end());
  if (n % 3 == 0) {
    if ((camels[0] != camels[n / 3 - 1]) ||
        (camels[n / 3] != camels[2 * n / 3 - 1]) ||
        (camels[2 * n / 3] != camels[n - 1])) {
      b = false;
    }
    if (xo.size() == 1) {
      if (camels[0] == 0) {
        cout << "Yes";
      }
    } else if (xo.size() == 2 && b) {
      long long num = 0;
      for (int i = 0; i < camels.size(); i++) {
        if (camels[i] == 0) {
          num++;
        }
      }
      if (num == n / 3) {
        cout << "Yes";
      } else {
        cout << "No";
      }
    } else if (xo.size() == 3 && b) {
      bool ans = true;
      long long c = 0;
      for (auto itr = xo.begin(); itr != xo.end(); itr++) {
        c = c ^ *itr;
      }
      if (c != 0) {
        ans = false;
      }
      if (ans) {
        cout << "Yes";
      } else {
        cout << "No";
      }
    } else {
      cout << "No";
    }
  } else {
    if (xo.size() == 1) {
      if (camels[0] == 0) {
        cout << "Yes";
      }
    } else {
      cout << "No";
    }
  }
  int l;
  cin >> l;
}
