#include <bits/stdc++.h>
using namespace std;
signed main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  int cnt0 = 0;
  for (int i = 0; i < n; i++)
    if (!a[i]) cnt0++;
  if (cnt0 == n) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < n; i++) mp[a[i]]++;
  if (mp.size() == 2) {
    if (cnt0 == n * 2 / 3)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (mp.size() == 3) {
    vector<int> u;
    for (auto x : mp) u.push_back(x.first);
    if (u[0] ^ u[1] == u[2])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
  return 0;
}
