#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, -1, 1, 1, 1, -1, -1};
int dy[] = {-1, 1, 0, 0, 1, -1, 1, -1};
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return (a / gcd(a, b)) * b; }
int main() {
  fast();
  int n;
  cin >> n;
  int Num;
  set<int> st;
  map<int, int> mp;
  for (int i = 0; i < n; i++) cin >> Num, st.insert(Num), mp[Num]++;
  if (st.size() == 1) {
    if (mp[0] == n)
      cout << "Yes";
    else
      cout << "No";
  } else if (st.size() == 2) {
    if (n % 2 == 0 && mp[0] == n / 2)
      cout << "Yes";
    else
      cout << "No";
  } else if (st.size() == 3) {
    int cnt = 0;
    vector<int> v(st.begin(), st.end());
    if (v[0] == (v[1] ^ v[2])) cnt++;
    if (v[1] == (v[0] ^ v[2])) cnt++;
    if (v[2] == (v[0] ^ v[1])) cnt++;
    if (cnt == 3 && mp[v[0]] == mp[v[1]] && mp[v[0]] == mp[v[2]])
      cout << "Yes";
    else
      cout << "No";
  } else {
    cout << "No";
  }
}
