#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(x)    (x).begin(),(x).end()
typedef long long ll;
const int MOD = (int)1e9 + 7;

int main(){
  int n;
  cin>>n;
  bool ans = false;
  vector<int> a(n);
  rep(i,n) cin>>a[i];
  sort(all(a));
  /*
  if(a[n-1] == 0){
    cout<<"Yes"<<endl;
    return 0;
  }
  if(n%3!=0){
    cout<<"No"<<endl;
    return 0;
  }
  if(a[0]==0){
    if(a[n/3-1] == 0 && a[n/3] == a[n-1]) ans = true;
    else ans = false;
  }
  else{
    if(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[n/3] != a[2*n/3]
        && a[0]^a[n/3] == a[2*n/3]) ans = true;
    else ans = false;
  }

  */
  vector<int> baket(3,0);
  vector<int> num(3,0);
  int buf = -1;
  int now = -1;
  for(e:a){
    //cout<<e<<endl;
    if(e>now){
      now = e;
      buf += 1;
      if(buf == 3){
        cout<< "No" << endl;
        return 0;
      }
      num[buf] = now;
    }
    baket[buf]++;
  }
  if(buf == 0 && num[0] == 0)
    ans = true;
  else if (buf == 1 && num[0] == 0 && baket[0]*2 == baket[1])
    ans = true;
  else if (num[0] != 0 && baket[0] == baket[1] && baket[1] == baket[2]
        && num[0]^num[1]==num[2])
    ans = true;
  string s = (ans) ? "Yes" : "No";
  cout<<s<<endl;
}

