#include <bits/stdc++.h>
using namespace std;
const long long LINF = 1001002003004005006ll;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int main() {
  int n;
  cin >> n;
  long long a[3] = {-1, -1, -1};
  int c = 0;
  for (int i = 0; i < n; i++) {
    long long t;
    cin >> t;
    if (t != a[0] && t != a[1] && t != a[2]) {
      if (c == 3) {
        cout << "No" << endl;
        return 0;
      }
      a[c] = t;
      c++;
    }
  }
  bool flag = true;
  if (a[0] != (a[1] ^ a[2])) flag = false;
  if (a[1] != (a[0] ^ a[2])) flag = false;
  if (a[2] != (a[0] ^ a[1])) flag = false;
  cout << (flag ? "Yes" : "No") << endl;
  return 0;
}
