using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

class Program {
    static void Main (string[] args) {
        int n = int.Parse(Console.ReadLine());
        string[] a = Console.ReadLine ().Split(' ');
        long[] x = new long[n];
        int ok = 0;
        long kijyun = 0;
        string ans = "No";
        int flg = 0;

        for(int i=0;i<n;i++){
            x[i] = long.Parse(a[i]);
        }

        for(int i=0;i<n;i++){
            kijyun = x[i];
            for(int j=0;j<n;j++){
                int ii = i + 1;
                if(ii >= n){
                    ii = 0;
                }

                if(i != j){
                    if(ii != j){
                        long xor = x[ii] ^ x[j];
                        if(kijyun ==  xor){
                            ok++;
                        }
                    }
                }
            }
            if(ok < 1){
                flg++;
                break;
            }
        }

        if(flg < 1){
            ans = "Yes";
        }

        Console.WriteLine(ans);

    }
}