#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 60;
const double pi = acos(-1);
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
int n;
vector<int> a;
int main() {
  cin >> n;
  int A = -1, B = -1;
  a = vector<int>(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (A == -1)
      A = a[i];
    else if (A != a[i] && B == -1)
      B = a[i];
  }
  if (B == -1 && A == 0)
    cout << "Yes" << endl;
  else {
    vector<int> b(n);
    b[0] = A, b[1] = B;
    for (int i = 2; i < n; i++) b[i] = b[i - 1] ^ b[i - 2];
    bool flag = 1;
    if (b[0] != (b[n - 1] ^ b[n - 2])) flag = 0;
    if (b[1] != (b[0] ^ b[n - 1])) flag = 0;
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    if (a != b) flag = 0;
    cout << (flag ? "Yes" : "No") << endl;
  }
}
　
