#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N], f = 0;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    if (a[i] != 0) f = 1;
  }
  if (N % 3 != 0) {
    if (f == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    vector<int> t;
    for (int i = 0; i < N; i++) {
      int q = 0;
      for (int j = 0; j < t.size(); j++) {
        if (a[i] == t[j]) q = 1;
      }
      if (q == 0) {
        t.push_back(a[i]);
      }
      if (t.size() > 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (t.size() == 1) {
      if (t[0] == 0)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else if (t.size() == 2) {
      int c = 0, d = 0;
      for (int i = 0; i < N; i++) {
        if (a[i] == t[0])
          c++;
        else
          d++;
      }
      if (c < d) {
        if (t[0] == 0) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      } else {
        if (t[1] == 0) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
      }
    } else {
      if ((t[0] ^ t[1]) == t[2] && (t[0] ^ t[2]) == t[1] &&
          (t[2] ^ t[1]) == t[0]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
