#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int nx[2] = {1, 0};
int ny[2] = {0, 1};
ll gcd(ll a, ll b) {
  if (b > a) swap(a, b);
  ll r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  int n;
  bool flag = true;
  cin >> n;
  int r = n % 3;
  if (r == 0) {
    int x, y, xy;
    for (int i = 0; i < (int)(n); i++) {
      int a;
      cin >> a;
      if (i == 0)
        x = a;
      else if (i == 1) {
        y = a;
        xy = x ^ y;
      } else {
        if (i % 3 == 0) {
          if (a != x) flag = false;
        } else if (i % 3 == 1) {
          if (a != y) flag = false;
        } else {
          if (a != xy) flag = false;
        }
      }
    }
  } else {
    for (int i = 0; i < (int)(n); i++) {
      int a;
      cin >> a;
      if (a != 0) flag = false;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
