#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(auto& i:a)cin>>i;
  sort(a.begin(),a.end());
  cout<<(!a[n-1]||(!a[n/3-1]&&a[n/3]==a[n-1])||(a[0]==a[n/3-1]&&a[n/3]==a[2*n/3-1]&&a[2*n/3]==a[n-1]&&!(a[0]^a[n/3]^a[2*n/3]))?"Yes":"No");
}