#include <bits/stdc++.h>
using namespace std;

int main () {
  
  int N;
  cin >> N;
  
  vector<long long> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  
  set<int> S;
  map<int, int> MAP;
  
  for (int i = 0; i < N; i++) {
    if (!S.count(a[i])) S.insert(a[i]);
    MAP[a[i]]++;
  }
  
  if (S.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  
  vector<int> num(3);
  
  for (int i = 0; i < 3; i++) {
    num[i] = *rbegin(S);
    S.erase(num[i]);
  }
  
  int b = num[0] ^ num[1];
  
  if (MAP[num[0]] != MAP[num[1]] || MAP[num[1]] != MAP[num[2]] || b != num[2]) {
    cout << "No" << endl;
    return 0;
  }
  
  cout << "Yes" << endl;
  return 0;
  
}