#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
int main() {
  int N;
  cin >> N;
  int a[N];
  for (int i = 0; i < N; i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  int cnt[4] = {0};
  int tmp[4] = {0};
  int pos = 0;
  tmp[0] = a[0];
  cnt[pos]++;
  for (int i = 1; i < N && pos < 3; i++) {
    if (a[i] != a[i - 1]) {
      pos++;
      tmp[pos] = a[i];
    }
    cnt[pos]++;
  }
  if (pos < 3 && cnt[0] == cnt[1] && cnt[1] == cnt[2] &&
      tmp[0] ^ tmp[1] == tmp[2])
    cout << "Yes"
         << "\n";
  else if (pos < 2 && cnt[1] / cnt[0] == 2 && tmp[0] == 0)
    cout << "Yes"
         << "\n";
  else if (pos < 1 && tmp[0] == 0)
    cout << "Yes"
         << "\n";
  else
    cout << "No"
         << "\n";
  return 0;
}
