#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  bool flag = true;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < N; i++) {
    if (a[i] != 0) {
      flag = false;
      break;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else {
    bool flag2 = false;
    sort(a.begin(), a.end());
    a.push_back(-1);
    vector<pair<int, int>> p;
    int c = 0;
    for (int i = 0; i < N; i++) {
      c++;
      if (a[i] != a[i + 1]) {
        p.push_back(pair<int, int>(a[i], c));
        c = 0;
      }
    }
    sort(p.begin(), p.end());
    if (p.size() == 2) {
      if (p[0].first == 0 && p[1].second == (2 * N) / 3 &&
          p[0].second == N / 3 && N % 3 == 0) {
        flag2 = true;
      }
    }
    if (p.size() == 3) {
      if (p[0].first ^ p[1].first ^ p[2].first == 0 && p[0].second == N / 3 &&
          p[1].second == N / 3 && p[2].second == N / 3 && N % 3 == 0) {
        flag2 = true;
      }
    }
    if (flag2)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
