#include <bits/stdc++.h>

using namespace std;

#define range(i, m, n) for(int i = m; i < n; i++)
#define husk(i, m, n) for(int i = m; i > n; i--)

int n;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  map<int, int> a;
  range(i, 0, n) {
    int x;
    cin >> x;
    a[x]++;
  }
  int sz = a.size();
  if(sz > 3) {
    cout << "No";
    return 0;
  }
  if(sz == 1) {
    if(a.begin()->first) {
      cout << "No";
      return 0;
    } 
  }
  if(sz == 2) {
    int x = a.begin()->first, sx = a[x];
    int y = next(a.begin())->first, sy = a[y];
    if(x || sy != 2 * sx) {
      cout << "No";
      return 0;
    }
  }
  if(sz == 3) {
    int cur = 0;
    for(auto it : a) {
      cur ^= it->first;
      if(it.second != a.begin()->second) {
        cout << "No";
        return 0;
      }
    }
    if(cur) {
      cout << "No";
      return 0;
    }
  }
  cout << "Yes";
  return 0;
}
