#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1000000007LL;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  bool abc = true;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] != 0) abc = false;
  }
  long long a1, a2, a3;
  if (abc == false) {
    sort(a.begin(), a.end());
    a1 = a[0];
    a3 = a[n - 1];
    a2 = a[n / 2];
    if (a1 ^ a2 ^ a3 == 0) {
      long long cnt1 = 0;
      long long cnt2 = 0;
      long long cnt3 = 0;
      for (int i = 0; i < n; i++) {
        if (a[i] == a1) cnt1++;
        if (a[i] == a2) cnt2++;
        if (a[i] == a3) cnt3++;
      }
      if (cnt1 == cnt2 && cnt1 == cnt3 && cnt3 == n / 3) abc = true;
      if (n % 3 != 0) abc = false;
    }
  }
  if (abc == false) {
    sort(a.begin(), a.end());
    a1 = a[0];
    a3 = a[n - 1];
    if (a1 == 0) {
      int cnt = 0;
      int cnt4 = 0;
      for (int i = 0; i > n; i++) {
        if (a[i] == 0) cnt++;
        if (a[i] == a[n - 1]) cnt4++;
      }
      if (cnt == n / 3 && cnt4 == n / 3 * 2) abc = true;
    }
    if (n % 3 != 0) abc = false;
  }
  if (abc == true)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
