#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
const long long LINF = 1e18;
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  sort((a).begin(), (a).end());
  if (n % 3 != 0)
    cout << "No" << endl;
  else if (a[n / 3 - 1] == 0 && a[n / 3] == a[n - 1])
    cout << "Yes" << endl;
  else if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] &&
           a[2 * n / 3] == a[n - 1] && (a[0] ^ a[n / 3] ^ a[2 * n / 3]) == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
