#include <bits/stdc++.h>
using namespace std;
int n, s, t, a[100005];
vector<int> b, c;
int main() {
  int i;
  cin >> n;
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n);
  s = 1;
  t = a[0];
  for (i = 1; i < n; i++) {
    if (a[i] != t) {
      b.push_back(t);
      c.push_back(s);
      s = 1;
    } else
      s++;
    t = a[i];
  }
  if (s > 0) {
    b.push_back(t);
    c.push_back(s);
  }
  if (b.size() == 2 && (c[0] == c[1] * 2 && b[1] == 0)) {
    cout << "Yes";
  } else if (b.size() == 3 && (c[0] == c[1] && c[1] == c[2]) &&
             (b[0] ^ b[1]) == b[2]) {
    cout << "Yes";
  } else {
    cout << "No";
  }
  return 0;
}
