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

int main(){
  int n;
  cin >> n;
  map<int, int> m;
  for(int i=0; i<n; i++){
    int num;
    cin >> num;
    m[num]++;
  }
  auto itr = m.begin();
  if(m.size() == 3){
    if((*(itr + 1)).second == n/3 && (*(itr + 2)).second == n/3 && (*(itr + 3)).second == n/3){
      if((*(itr + 1)).first ^ (*(itr + 2)).first == (*(itr + 3)).first){
        cout << "Yes" << endl;
        return 0;
      }
    }
  }else if(m.size() == 2 && m[0] = (*(itr + 2)).first/2){
    cout << "Yes" << endl;
    return 0;
  }else if(m.size() == 1 && (*(itr + 1)).first){
    cout << "Yes" << endl;
    return 0;
  }else{
    cout << "No" << endl;
    return 0;
  }
}
