#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  long long x = 0;
  long long a[n];
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    x = (x ^ a[i]);
  }
  if (n % 3 == 0) {
    if ((n / 3) % 2 == 1 && x == 0)
      cout << "Yes";
    else if ((n / 3) % 2 == 0 && x == 1)
      cout << "Yes";
    else
      cout << "No";
  } else {
    long long f = 1;
    for (long long i = 0; i < n; ++i)
      if (a[i] != 0) f = 0;
    if (f)
      cout << "Yes";
    else
      cout << "No";
  }
  return 0;
}
