#!/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;

if( $n_k > 3 ){
  print "No\n";
  exit(0);
}

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 ) ) 
        and $t{$k_t[0]} == $t{$k_t[1]} and $t{$k_t[1]} == $t{$k_t[2]};
  } elsif( $n_k == 2 ){
    $res = 'Yes'
      if ( ($k_t[0] - 0) == 0 and $t{$k_t[1]} == $t{$k_t[0]} * 2 ) 
        or ( ($k_t[1] - 0) == 0 and $t{$k_t[0]} == $t{$k_t[1]} * 2 );
  } 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);
