#include<iostream>
#define watch(x) cout<<(#x)<<" is "<<(x)<<" "
using namespace std;
int main()
{
  int n;
  cin>>n;
  vector<int> v(n);
  for(int i=0; i<n; i++)
  {
    cin>>v[i];
  }
  int left,right;
  for(int i=0; i<n; i++)
  {
    left = v[(i-1+n)%n];
    right = v[(i+1)%n];
    if((left^right) != v[i])
    {
      cout<<"No\n";
      return 0;
    }
  }
  cout<<"Yes\n";
  return 0;
}