#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, count = 0;
  cin >> N;
  long long a;
  vector<pair<long long, int> > V;
  for (int i = 0; i < N; i++) {
    bool flag = false;
    cin >> a;
    for (int i = 0; i < (int)V.size(); i++) {
      if (V[i].first == a) {
        V[i].second++;
        flag = true;
      }
    }
    if (flag) continue;
    V.push_back(pair<long long, int>(a, 1));
  }
  if ((int)V.size() == 3) {
    if (V[0].first ^ V[1].first ^ V[2].first == 0 &&
        V[0].second == V[1].second && V[1].second == V[2].second) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else if ((int)V.size() == 2) {
    if ((V[0].first == 0 || V[0].second * 2 == V[1].second) &&
        (V[1].first == 0 || V[1].second * 2 == V[0].second)) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else if ((int)V.size() == 1) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
