#include <bits/stdc++.h>
using namespace std;
int n;
int a[100005], c[100005], v[100005];
int main() {
  cout << setprecision(2) << fixed;
  ios::sync_with_stdio(false), cin.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  int cnt = 1, d = 1;
  v[0] = a[0];
  for (int i = 1; i < n; i++) {
    if (a[i] != a[i - 1]) {
      c[cnt - 1] = d;
      v[cnt++] = a[i];
      d = 1;
    } else
      d++;
  }
  c[cnt - 1] = d;
  if (cnt == 2) {
    if (c[0] > c[1] && v[0] != 0 && c[0] % 2 == 0)
      cnt++, v[2] = v[0], c[2] = c[0] = c[0] / 2;
    else if (c[1] > c[0] && v[1] != 0 && c[1] % 2 == 0)
      cnt++, v[2] = v[1], c[2] = c[1] = c[1] / 2;
  }
  if (cnt == 1 && v[0] == 0) {
    cout << "Yes";
    return 0;
  }
  if (cnt != 3 || v[0] ^ v[1] != v[2] || c[0] != c[1] || c[1] != c[2] ||
      c[2] != c[0])
    cout << "No";
  else
    cout << "Yes";
  return 0;
}
