#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[100010];
map<long long, long long> mp;
signed main() {
  scanf("%lld", &n);
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (long long i = 0; i < (long long)(n); i++) {
    scanf("%lld", &a[i]);
    mp[a[i]]++;
  }
  sort(a, a + n);
  if (mp.size() == 1 && mp[0] == n)
    cout << "Yes" << endl;
  else if (mp.size() == 2 && mp[a[n - 1]] == 2 * n / 3 && mp[0] == n / 3) {
    cout << "Yes" << endl;
  } else if (mp.size() == 3 && (a[0] xor a[n / 2] xor a[n - 1]) == 0 &&
             mp[a[0]] == n / 3 && mp[a[n / 2]] == n / 3 &&
             mp[a[n - 1]] == n / 3) {
    cout << "Yes" << endl;
  } else
    cout << "No" << endl;
}
