#include <bits/stdc++.h>
const int INF = 1000000007;
const long double EPS = 1e-15;
const long double PI = acos(-1);
using namespace std;
using Graph = vector<vector<int>>;
using Graph_weighted = vector<vector<pair<int, int>>>;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long ceil(const long long a, const long long b) { return (a + b - 1) / b; }
int main() {
  int n;
  cin >> n;
  map<long long, long long> m;
  for (int i = 0; i < (n); ++i) {
    int tmp;
    cin >> tmp;
    m[tmp]++;
  }
  bool tmp = true;
  for (auto i : m)
    if (i.first != 0) tmp = false;
  if (tmp) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3 == 0 && m.size() == 3) {
    bool ans = true;
    for (auto i : m)
      if (i.second != (n / 3)) ans = false;
    if (!ans) {
      cout << "No" << endl;
    } else {
      vector<long long> A;
      for (auto i : m) A.push_back(i.first);
      if ((A[0] ^ A[1]) == A[2])
        cout << "Yes" << endl;
      else if ((A[0] ^ A[2]) == A[1])
        cout << "Yes" << endl;
      else if ((A[1] ^ A[2]) == A[0])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  } else
    cout << "No" << endl;
  return 0;
}
