#include <bits/stdc++.h>
#define rg register
#define MEM(NAME) memset(NAME,0,sizeof NAME)
using namespace std;
typedef long long ll;
template<typename T>
inline bool read(T &n) {
    T ans = 0, flag = 1;
    char ch;
    while ((ch = getchar()) < '0' || ch > '9') if (ch == '-') flag = -1; else if (ch == EOF) return false;
    ans = ch - '0';
    while ((ch = getchar()) >= '0' && ch <= '9') ans = ans * 10 + ch - '0';
    n = ans * flag;
    return true;
}
inline ll read() {
    ll ans = 0, flag = 1;
    char ch;
    while ((ch = getchar()) < '0' || ch > '9') if (ch == '-') flag = -1;
    ans = ch - '0';
    while ((ch = getchar()) >= '0' && ch <= '9') ans = ans * 10 + ch - '0';
    return ans * flag;
};
int pre[100005];
unordered_map<int,int> M;
vector<int> v,v2;
int main() {
    int n,cnt=0;read(n);
    for(rg int i=1;i<=n;i++){
        read(pre[i]);
        if(M.find(pre[i])==M.end()) {
            M[pre[i]]=++cnt;
            v.push_back(1);
            v2.push_back(pre[i]);
        }
        else v[M[pre[i]]-1]++;
    }
    if(n%3==0){
        if((v.size()==2&&max(v[0],v[1])==2*min(v[0],v[1])&&(v2[0]==0||v2[1]==0)||(v.size()==1&&pre[1]==0)||(v.size()==3&&v[0]==v[1]&&v[1]==v[2]&&v2[0]^v2[1]==v2[2]))) puts("Yes");
        else puts("No");
    }
    else{
        if(v.size()==1&&pre[1]==0) puts("Yes");
        puts("No");
    }
    return 0;
}v