#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int INF = (int)1e18;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T>
inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  map<int, int> a;
  for (int i = 0; i < (int)(n); i++) {
    int x;
    cin >> x;
    a[x]++;
  }
  if (3 < a.size()) {
    cout << "No" << endl;
    return 0;
  }
  auto it = a.begin();
  vector<int> aa, cnt;
  while (it != a.end()) {
    aa.push_back(it->first);
    cnt.push_back(it->second);
    it++;
  }
  if (aa.size() == 1) {
    if (aa[0] == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (aa.size() == 2) {
    if (aa[0] != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (cnt[0] == 1 && cnt[1] == 2) {
      cout << "Yes" << endl;
      return 0;
    }
    if (cnt[0] % 2 == 0 && cnt[1] % 3 == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if ((aa[0] ^ aa[1]) != aa[2]) {
    cout << "No" << endl;
    return 0;
  }
  if (cnt[0] == cnt[1] && cnt[0] == cnt[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}
