#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1000000000;
int main() {
  int N;
  cin >> N;
  vector<long long> a(N);
  bool ans0 = true;
  for (long long i = 0; i < N; ++i) {
    cin >> a[i];
    if (a[i] != 0) {
      ans0 = false;
    }
  }
  if (ans0) {
    cout << "Yes" << endl;
  } else {
    bool ans = true;
    if (N % 3 != 0) {
      ans = false;
    } else {
      map<long long, int> m;
      int n = N / 3;
      for (long long i = 0; i < N; ++i) {
        m[a[i]]++;
      }
      if (m.size() != 3) {
        ans = false;
      } else {
        vector<int> b(3);
        int cnt = 0;
        for (auto x : m) {
          if (x.second != n) {
            ans = false;
            break;
          } else {
            b[cnt] = x.first;
            cnt++;
          }
        }
        int x = b[0] ^ b[1], y = b[1] ^ b[2], z = b[2] ^ b[0];
        if (x != b[2] || y != b[0] || z != b[1]) {
          ans = false;
        }
      }
    }
    if (ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
