#include <bits/stdc++.h>
using namespace std;
using long long int = long long int;
using pii = pair<int, int>;
using pll = pair<long long int, long long int>;
using vi = vector<int>;
using vl = vector<long long int>;
using vii = vector<pii>;
using vll = vector<pll>;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  scanf("%d", &N);
  vi a(N + 100, (2e9));
  for (long long int i = 0; i < N; i++) {
    scanf("%d", &a[i]);
  }
  bool OK = true;
  sort(a.begin(), a.end());
  priority_queue<int> p;
  int A = a[0];
  int B = a[N / 3];
  int AB = a[N / 3 * 2];
  if (N % 3) OK = false;
  for (long long int i = 0; i < N / 3; i++) {
    if (A != a[i]) OK = false;
    if (B != a[N / 3 + i]) OK = false;
    if (AB != a[N / 3 * 2 + i]) OK = false;
  }
  if (A xor B != AB) OK = false;
  long long int tmp = 0;
  for (long long int i = 0; i < N; i++) tmp += a[i];
  if (tmp == 0) OK = true;
  (OK) ? printf("Yes\n") : printf("No\n");
  return 0;
}
