#include <bits/stdc++.h>
using namespace std;
const long mod = 1e9 + 7;
const int size = 1e5;
int main() {
  int N;
  cin >> N;
  long A[N];
  map<long, int> count;
  int temp = 0;
  vector<long> B;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    if (count[A[i]] == 0) {
      temp++;
      if (temp <= 3) B.push_back(A[i]);
    }
    count[A[i]]++;
  }
  if (temp > 3)
    cout << "No" << endl;
  else if (temp == 1) {
    if (B[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (temp == 2) {
    if (B[0] == 0 || B[1] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (temp == 3) {
    if ((B[0] ^ B[1]) == B[2]) {
      int a = count[B[0]];
      int b = count[B[1]];
      int c = count[B[2]];
      if (a == b && b == c)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    } else
      cout << "No" << endl;
  }
}
