#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  ;
  int A[N];
  bool is_zero = true;
  for (int i = 0; i < (N); ++i) {
    cin >> A[i];
    ;
    if (A[i] != 0) is_zero = false;
    if (i - 3 >= 0 && A[i - 3] != A[i]) {
      cout << "No"
           << "\n";
      return 0;
    }
  }
  if (is_zero) {
    cout << "Yes"
         << "\n";
    return 0;
  } else if (N % 3 != 0) {
    cout << "No"
         << "\n";
    return 0;
  } else {
    if (A[0] ^ A[1] ^ A[2] == 0)
      cout << "Yes"
           << "\n";
    else
      cout << "No"
           << "\n";
  }
  return 0;
}
