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