#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define ll long long
using namespace std;

ll binary(ll bina){
    ll ans = 0;
    for (int i = 0; bina>0 ; i++)
    {
        ans = ans+(bina%2)*pow(10,i);
        bina = bina/2;
    }
    return ans;
}


int main() {
    int N; cin >> N; map<ll,ll> m;
    int b[10];
    rep(i,N){
        ll a; cin >> a;
        m[a]++;
    }
    if(N%3 != 0){
        if(map[0] != 0){
            cout << "No" << endl;
            return 0;
        }
    }
     if(m.size() >= 3 || m.size() == 1){
         cout << "No" << endl;
         return 0;
     }

     else{
         if(m.size() == 3){
             for(auto p : m){
                 if(p.second%(N/3) != 0)
                 {cout << "No" << endl;
                 return 0;} 
                 b.pushback(p.first); 
              }
              if(b[0]^b[1] == b[2] && b[1]^b[2] == b[0]
              && b[2]^b[0] == b[1])
              cout << "Yes" << endl;
              else cout << "No" << endl;
         }
         else if(m.size() == 2){
             for(auto p : m){
                 if(p.second%(N/3) != 0)
                 {
                     cout << "No" << endl;
                     return 0;
                 }
                 b.pushback(p.first);}
                 if(b[0]^b[1] == b[0])
                 cout << "Yes" << endl;
                 else cout << "No" << endl;

             }

             
         }

     }

    return 0;
}

