#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
#include <random>
#include <queue>
#include <deque>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;

const int INF = (1 << 30) - 1;
const ll INFLL= (1LL << 61) - 1;
const int MOD = 1000000007;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin>>N;
  map<int,int> mp;
  REP(i,N){
    int tmp;
    cin>>tmp;
    mp[tmp]++;
  }
  bool ans=false;
  if(mp[0]==N)ans=true;
  if(N%3!=0){
    if(mp.size==2){
      if(mp[0]==N)ans=true;
    }
    if(mp.size==3){
      if(
        (mp.begin()->first ^ mp.begin()++->first ^ (mp.begin()++)++->first) == 0 &&
        mp.begin()->second == N/3 && mp.begin()++->second == N/3
      )ans=true;
    }
  }
  if(ans) cout<<"Yes"<<endl; else cout<<"No"<<endl;
}
