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

int main(){
    int n;
  bool B;
    cin >> n;
    vector<int> v;
    rep(i,n+1){
        cin>>i;
      	v.push_back(i);
;    }
 	for(int i = 0;i<n;i++)
      if(v[i-1]^v[i+1]==v[i]){
     	B=true;
      }else{
 		B=false;
      }
  if(B){
  cout<<"Yes"<<endl;
  }else{
  cout<<"No"<<endl;
  }