#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long INF = 1ll << 60;
const double pi = acos(-1);
const double eps = 1e-8;
const long long mod = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, -1, 0, 1};
int n;
map<int, int> mp;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    mp[x]++;
  }
  if (mp.size() == 1) {
    if (mp[0] == n)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (n % 3 != 0)
      cout << "No" << endl;
    else {
      if (mp.size() == 2) {
        if (mp[0] == n / 3)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else if (mp.size() == 3) {
        bool B = 1;
        vector<int> a;
        for (auto i = mp.begin(); i != mp.end(); i++) {
          a.push_back(i->first);
          if (i->second != n / 3) B = 0;
        }
        if (a[0] ^ a[1] != a[2]) B = 0;
        cout << (B ? "Yes" : "No") << endl;
      } else
        cout << "No" << endl;
    }
  }
}
