//Daniel Grzegorzewski
// while (clock()<=69*CLOCKS_PER_SEC)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")

#define MP make_pair
#define PB push_back
#define ST first
#define ND second

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

//X.find_by_order(k); - zwraca iterator na k-ty element (numeracja od zerowego)
//X.order_of_key(k); - zwraca liczbę elementów ostro mniejszych niż k

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

int n, x, xr, nz;
map<int, int> hm;
set<int> s;

int main() {
  init_ios();
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> x;
    if (x != 0)
      nz = x;
    ++hm[x];
    xr ^= x;
    s.insert(x);
  }
  if (xr != 0) {
    cout<<"No\n";
    return 0;
  }
  if (s.size() == 1) {
    if (x == 0)
      cout<<"Yes\n";
    else
      cout<<"No\n";
    return 0;
  }
  if (n%3) {
    cout<<"No\n";
    return 0;
  }
  if (s.size() == 2) {
    if (s.find(0) != s.end() && 2*hm[0] == hm[nz])
      cout<<"Yes\n";
    else
      cout<<"No\n";
  }
  bool git = true;
  if (n%3)
    git = false;
  for (int val: s) {
    if (hm[val] != n/3)
      git = false;
  }
  if (git)
    cout<<"Yes\n";
  else
    cout<<"No\n";
}