#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-10;
const int INF = 1e9;
const long long LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
int main() {
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < (n); ++i) cin >> v[i];
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  map<int, int> mp;
  for (int i = 0; i < (n); ++i) mp[v[i]]++;
  if (mp.size() != 3) {
    cout << "No" << endl;
    return 0;
  }
  vector<int> u;
  for (auto p : mp) {
    u.push_back(p.first);
    if (p.second != n / 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (u[0] ^ u[1] ^ u[2]) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
}
