#include <bits/stdc++.h>
using namespace std;
const long long INF = LLONG_MAX / 2;
const long long MOD = 1e9 + 7;
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  long long a[N];
  bool isok = true;
  for (long long i = 0; i < N; i++) {
    cin >> a[i];
    isok &= a[i] == a[i % 3];
  }
  cout << (isok && ((a[0] ^ a[1]) == a[2]) ? "Yes" : "No") << endl;
  return 0;
}
