#include<bits/stdc++.h>

#define mp make_pair
#define pb push_back
#define f first
#define s second 
#define sz(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define forn(i, x, y) for(int i = x; i <= y; i++)
#define forev(i, y, x) for(int i = y; i >= x; i--)

using namespace std;

const int maxn = (int)3e5 + 100;
const int mod = (int)1e9 + 7;
const int P = (int)1e6 + 7;
const int inf = (int)1e9 + 7;

typedef pair<int, int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef long double ld;

int n, a[maxn];
main () {
  cin >> n;
  forn(i, 1, n) cin >> a[i];
  do{
    int bad = 0;
    a[n + 1] = a[1];
    a[0] = a[n];
    forn(i, 1, n){
      if((a[i - 1] ^ a[i + 1]) != a[i]){
        bad = 1;
      }
    }
    if(!bad){
      cout << "Yes";
      return 0;
    }
  }while(next_permutation(a + 1, a + n + 1));
  cout << "No";
}