#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
signed main() {
  long long N;
  cin >> N;
  long long a[N];
  vector<long long> ans;
  for (long long i = (0); i < (N); i++) {
    cin >> a[i];
  }
  sort(a, a + N);
  if (N % 3 == 0) {
    ans.push_back(a[0]);
    for (long long i = 1; i < N; i++) {
      if (a[i] != a[i - 1]) {
        ans.push_back(a[i]);
      }
    }
    switch (ans.size()) {
      case 1: {
        if ((ans[0] ^ a[0] ^ a[0]) == 0) {
          cout << "Yes" << endl;
        } else {
          cout << "No" << endl;
        }
        break;
      }
      case 3: {
        if ((ans[0] ^ ans[1] ^ ans[2]) == 0) {
          long long x1 = 1, x2 = 1, x3 = 1;
          long long i = 1;
          for (; i < N; i++) {
            if (a[i] != a[i - 1]) {
              i++;
              break;
            }
            x1++;
          }
          for (; i < N; i++) {
            if (a[i] != a[i - 1]) {
              i++;
              break;
            }
            x2++;
          }
          for (; i < N; i++) {
            if (a[i] != a[i - 1]) {
              i++;
              break;
            }
            x2++;
          }
          if (x1 == x2 == x3 == (N / 3)) {
            cout << "Yes" << endl;
          } else {
            cout << "No" << endl;
          }
        } else {
          cout << "No" << endl;
        }
        break;
      }
      default: {
        cout << "No" << endl;
        break;
      }
    }
  } else {
    if (a[0] == a[N - 1] && a[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
