# include<iostream>
# include<vector>
# include<string>

using namespace std;
using long long ll;

int main(void){
  int n;
  string flag = "Yes";
  cin >> n;
  vector<ll> a(n);
  for(int i=0; i<n; i++)
    cin >> a[i];

  for(int i=0; i<n; i++){
    if(i == 0){
      if((a[1] ^ a[n-1]) != a[0]){
        flag = "No";
      }
    }
    else if(i == n-1){
      if((a[n-2] ^ a[0]) != a[n-1]){
        flag = "No";
      }
    }
    else if((a[i-1] ^ a[i+1]) != a[i])
      flag = "No";
  }
  cout << flag << '\n';
  return 0;
}