#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, x;
  cin >> n;
  map<int, int> m;
  for (int i = 0; i < (n); i++) {
    cin >> x;
    m[x]++;
  }
  vector<pair<int, int>> a;
  for (auto &p : m) a.push_back(p);
  if (a.size() == 1 && a[0].first == 0 ||
      a.size() == 3 && (a[0].first ^ a[1].first) == a[2].first &&
          a[0].second == a[1].second && a[0].second == a[2].second)
    cout << "Yes";
  else
    cout << "No";
}
