#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  long long int a[n];
  map<long long int, int> d, dd;
  for (int i = 0; i < n; i++) {
    long long int e;
    cin >> e;
    d[e]++;
    a[i] = e;
  }
  long long int b[n];
  b[0] = a[0], b[1] = a[1];
  for (int i = 2; i < n; i++) {
    b[i] = b[i - 1] ^ b[i - 2];
  }
  if ((a[n - 1] ^ a[n - 2]) != a[0] || (a[0] ^ a[n - 1]) != a[1]) {
    cout << "No";
    return 0;
  }
  for (long long int e : b) {
    dd[e]++;
  }
  cout << (d == dd ? "Yes" : "No");
}
