#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, acnt, bcnt, ccnt;
  long long a, b, c, in;
  cin >> n;
  a = -1;
  b = -1;
  c = -1;
  acnt = 0;
  bcnt = 0;
  ccnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> in;
    if (in == a) {
      acnt++;
      continue;
    } else if (in == b) {
      bcnt++;
      continue;
    } else if (in == c) {
      ccnt++;
      continue;
    } else {
      if (a == -1) {
        a = in;
        acnt++;
        continue;
      } else if (b == -1) {
        b = in;
        bcnt++;
        continue;
      } else if (c == -1) {
        c = in;
        ccnt++;
        continue;
      }
      cout << "No" << endl;
      return 0;
    }
  }
  if (b == (-1) && c == (-1)) {
    if (a == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  if (c == (-1)) {
    if ((a ^ b) == a) {
      if (acnt == 2 * bcnt) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
    if ((a ^ b) == b) {
      if (bcnt == 2 * acnt) {
        cout << "Yes" << endl;
        return 0;
      } else {
        cout << "No" << endl;
        return 0;
      }
    }
  }
  if ((a ^ b) != c) {
    cout << "No" << endl;
    return 0;
  }
  if ((acnt == bcnt) && (bcnt == ccnt)) {
    cout << "Yes" << endl;
    return 0;
  }
  return 0;
}
