include <bits/stdc++.h>
using namespace std;

int main()
{
  long long int N;
  cin >> N;
  vector<long long int> a(N);
  for (int i = 0; i < N; i++)
  {
    cin >> a.at(i);
  }
  bool can = false;
  map<long long, long long> mp;
  for (int i = 0; i < N; i++)
    mp[a[i]]++;
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (mp.size() == 1 && a[0] == 0)
    can = true;
  if (mp.size() == 2)
  {
    if (n % 3 == 0 && a[0] == 0 && mp[a[0]] == n / 3)
      can = true;
  }
  if (n % 3 == 0 && mp[a[0]] == n / 3 && mp[a[1]] == n / 3 && mp[a[2]] == n / 3 && (a[0] ^ a[1] ^ a[2]) == 0)
    can = true;
  if (can)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
