#include <bits/stdc++.h>
using namespace std;
long long int general, total;
long long int num[100005];
long long int num2[100005];
map<long long int, long long int> mp;
int main() {
  double ans = 0.0, half, d, d1, d2;
  string s, s1;
  long long int sum, sum2, n1, n2, n3;
  long long int m, n, o, i, j, k = 1;
  long long int a, a1, a2, a3, a4, a5, a6;
  sum = sum2 = n1 = n2 = n3 = 0;
  a = a1 = a2 = a3 = a4 = a5 = a6 = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> m;
    mp[m]++;
    if (mp.size() > 3) {
      cout << "No";
      return 0;
    }
  }
  for (auto& au : mp) {
    if (au.second != n / 3) {
      cout << "No";
      return 0;
    }
    num[a++] = au.first;
  }
  if ((num[0] ^ num[2]) == num[1])
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
