#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  long long a = INF;
  long long b = INF;
  long long c = INF;
  int a_count = 0;
  int b_count = 0;
  int c_count = 0;
  for (int i = (int)(0); i < (int)(n); ++i) {
    int tmpx;
    cin >> tmpx;
    if (a == INF) {
      a = tmpx;
      a_count++;
    } else if (a == tmpx) {
      a_count++;
    } else if (b == INF) {
      b = tmpx;
      b_count++;
    } else if (b == tmpx) {
      b_count++;
    } else if (c == INF) {
      c = tmpx;
      c_count++;
    } else if (c == tmpx) {
      c_count++;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (a_count == b_count && b_count == c_count && a ^ b == c) {
    cout << "Yes" << endl;
    return 0;
  } else if (b_count == 0 && c_count == 0 && a == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
