#include <iostream>
#include <vector>
using namespace std;

int main(){
  long long n;
  cin >> n;
  vector<int> vec;
  long long a = -1, b = -1, c = -1;
  long long acount = 0, bcount = 0, ccount = 0;
  for(long long i=0; i<n; i++){
    long long num;
    cin >> num;
    if(i == 0) a = num;
    else if(a != num && b == -1) b = num;
    else if(a != num && b != num && c == -1) c = num;
    else if(a != num && b != num && c != num){
      cout << "No" << endl;
      return 0;
    }
    if(a == num) acount++;
    if(b == num) bcount++;
    if(c == num) ccount++;
  }
  if(a != -1 && b != -1 && c != -1 && acount == bcount && bcount == ccount && ccount == acount){
    if(a ^ b ^ c == 0){
      cout << vec[9][1];
      cout << "Yes" << endl;
      return 0;
    }
  }else if(c == -1 && ((a == 0 && bcount - acount == acount) || (b == 0 && acount - bcount == bcount))){
    cout << "Yes" << endl;
    return 0;
  }else if(a == 0 && b == -1 && c == -1){
    cout << "Yes" << endl;
    return 0;
  }else{
    cout << "No" << endl;
    return 0;
  }
}
