#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = (0); i < (n); i++) cin >> a[i];
  bool zero = true;
  for (long long i = (0); i < (n); i++)
    if (a[i] != 0) zero = false;
  if (zero) {
    cout << "Yes" << endl;
    return 0;
  }
  if ((a[0] ^ a[1] ^ a[2]) != 0 || n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  for (long long i = (0); i < (n); i++)
    if (a[i] != a[i % 3]) {
      cout << "No" << endl;
      return 0;
    }
  cout << "Yes" << endl;
}
