#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int n, temp;
  cin >> n;
  if (n % 3 != 0) {
    cout << "No";
    exit(0);
  }
  set<long long int> s1;
  long long int val = n / 3;
  map<long long int, long long int> freq;
  while (n--) {
    cin >> temp;
    freq[temp]++;
    s1.insert(temp);
  }
  vector<long long int> final(s1.begin(), s1.end());
  if (final.size() != 3) {
    cout << "No";
    exit(0);
  }
  if (freq[final[0]] != val || freq[final[1]] != val) {
    cout << "No";
    exit(0);
  }
  long long int xor1 = final[0] ^ final[1] ^ final[2];
  if (xor1 != 0) {
    cout << "No";
    exit(0);
  }
  cout << "Yes";
  return 0;
}
