#!/usr/bin/perl
my ($n) = map { $_ - 0 } split(/\s+/,<STDIN>);
my @aa = map { $_ - 0 } split(/\s+/,<STDIN>);

my %t = ();

for(my $i=0;$i<=$#aa;$i++){
  $t{$aa[$i]} ++;
}
my @k_t = keys %t;
my $n_k = 1 + $#k_t;


my $res = 'No';
if( $n % 3 == 0 ){
  if( $n_k == 3 ){
    $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[1] - 0 ) ) == ( $k_t[2] - 0 );
  } elsif( $n_k == 2 ){
    $res = 'Yes' if ( ( $k_t[0] - 0 ) == 0 or ( $k_t[1] - 0 ) == 0 );
  } elsif( $n_k == 1 ){
    $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[0] - 0 ) == ( $k_t[0] - 0 ) );
  }
} else {
  if( $n_k == 1 ){
    $res = 'Yes' if ( ( $k_t[0] - 0 ) ^ ( $k_t[0] - 0 ) == ( $k_t[0] - 0 ) );
  }
}

print "$res\n";

exit(0);

