#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int i, j, cnt = 0;
  int n;
  cin >> n;
  ll a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  ll b[n];
  b[0] = a[0];
  cnt = 1;
  for (i = 1; i < n; i++) {
    if (a[i - 1] != a[i]) b[cnt++] = a[i];
  }
  if (cnt > 3) {
    cout << "No";
    return 0;
  }
  int c[3] = {0};
  for (i = 0; i < n; i++) {
    if (a[i] == b[0]) c[0]++;
    if (cnt >= 2) {
      if (a[i] == b[1]) c[1]++;
    }
    if (cnt == 3) {
      if (a[i] == b[2]) c[2]++;
    }
  }
  if (cnt == 1 && b[0] == 0)
    cout << "Yes";
  else if (cnt == 2 && 2 * c[0] == c[1] && b[0] == 0)
    cout << "Yes";
  else if (cnt == 3 && c[0] == c[1] && c[1] == c[2] && b[0] ^ b[1] == b[2])
    cout << "No";
  else
    cout << "No";
}
