#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  auto solve = [&]() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    map<int, int> c;
    for (int i = 0; i < n; ++i) {
      ++c[a[i]];
    }
    if (c.find(0) != c.end() && c[0] == n) {
      return 1;
    }
    if (n % 3 != 0) {
      return 0;
    }
    if (c.find(0) != c.end() && c[0] == n / 3 && c.size() == 2) {
      return 1;
    }
    if (c.size() == 3) {
      vector<pair<int, int>> a;
      for (auto i : c) {
        a.push_back(i);
      }
      if (a[0].second == a[1].second && a[1].second == a[2].second) {
        if (a[0].first ^ a[1].first == a[2].first) {
          return 1;
        }
      }
    }
    return 0;
  };
  cout << (solve() ? "Yes" : "No") << endl;
  return 0;
}
