#include <bits/stdc++.h>

using namespace std;

int main()
{
  int N; cin >> N;
  if (N%3 != 0) {
    cout << "No" << endl;
    return;
  }
  
  map<int, int> m;
  for (int i=0; i<N; i++) 
  {
    int a;cin >> a;
    m[a]++;
  }

  string ans;
  if (m.size() == 1) {
    ans = (m[0] == N) ? "Yes" : "No";
  } else if (m.size() == 2) 
  {
    bool isOk = true;
    for(var p : m)
    {
      if (p.first == 0) {
        if (p.second != N/3) isOk = false;
      } else {
        if (p.second != 2*N/3) isOk = false;
      }
      ans = (isOk) ? "Yes" : "No";
    }
  } else if (m.size() == 3) {
    bool isOk = true;
    int tmp = 0;
    for (var p : m) {
      if (p.second != N/3) isOk=false;
      tmp ^= p.first;
    }
    if (tmp != 0) isOk=false
    ans = (isOk) ? "Yes" : "No";
  }

  cout << ans << endl;
}