#include <bits/stdc++.h>
using namespace std;
long long MAX = 1000000007;
signed main() {
  long long n;
  cin >> n;
  long long a[3], t = 0, a0, l = 0, o = 0, u[3] = {};
  while (l != 3 && o < n) {
    t = 0;
    cin >> a0;
    o++;
    for (long long i = 0; i < l; i++) {
      if (a[i] == a0) {
        t = 1;
        u[i]++;
      }
    }
    if (t == 0) {
      a[l] = a0;
      u[l]++;
      l++;
    }
  }
  t = 0;
  for (long long i = o; i < n; i++) {
    cin >> a0;
    if (a[0] != a0 && a[1] != a0 && a[2] != a0) t = 1;
    if (a[0] == a0) u[0]++;
    if (a[1] == a0) u[1]++;
    if (a[2] == a0) u[2]++;
  }
  if (l >= 3) {
    if (t == 1)
      cout << "No";
    else {
      if (a[0] ^ a[1] == a[2]) {
        if (u[0] == u[1] && u[0] == u[2])
          cout << "Yes";
        else
          cout << "No";
      } else
        cout << "No";
    }
  } else {
    if (l == 1) {
      if (a[0] == 0)
        cout << "Yes";
      else
        cout << "No";
    }
    if (l == 2) {
      if ((u[0] == 2 * u[1] && a[1] == 0) || (u[0] * 2 == u[1] && a[0] == 0))
        cout << "Yes";
      else
        cout << "No";
    }
  }
  return 0;
}
