#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long mod = 1e9 + 7;
string S;
long long N, k, ans = 1;
long long a[100005];
long long beki[40];
bool flag = true;
map<int, int> mp;
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  if (a[0] == 0) {
    cout << "Yes" << endl;
  } else if (N % 3 != 0) {
    cout << "No" << endl;
  } else if (mp[0] == N / 3 && mp[a[N - 1]] == N * 2 / 3) {
    cout << "Yes" << endl;
  } else {
    int knd = 0;
    int ans = 0;
    for (auto ite = mp.begin(); ite != mp.end(); ite++) {
      if (ite->first == 0) continue;
      knd++;
      ans ^= ite->first;
      if (ite->second != N / 3) {
        ans = 1;
      }
    }
    if (knd == 3 && ans == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
