#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  bool ans = true;
  bool flag0 = true;
  for (int i = 0; i < (n); i++) {
    if (a[i] != 0) flag0 = false;
  }
  if (flag0) {
    ans = true;
  } else {
    if (n % 3) {
      ans = false;
    } else {
      vector<pair<int, int> > dic(3, pair<int, int>(-1, 0));
      for (int i = 0; i < (n); i++) {
        for (int j = 0; j < (3); j++) {
          if (a[i] != dic[j].first) {
            if (dic[j].first == -1) {
              dic[j].first = a[i];
              dic[j].second++;
              break;
            } else if (j == 2) {
              ans = false;
            }
          } else {
            dic[j].second++;
            break;
          }
        }
      }
      if (dic[1].first == -1) {
        ans = false;
      } else if (dic[2].first == -1) {
        if (dic[0].first == 0 && dic[0].second == n / 3) ans = true;
        if (dic[1].first == 0 && dic[1].second == n / 3) ans = true;
      } else {
        int tmp = 0;
        for (int i = 0; i < (3); i++) tmp ^= dic[i].first;
        if (tmp == 0) {
          if (dic[0].second == dic[1].second &&
              dic[1].second == dic[2].second) {
            ans = true;
          } else {
            ans = false;
          }
        } else {
          ans = false;
        }
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
