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