#include <bits/stdc++.h>
using namespace std;
const int N = 500023;
bool vis[N];
vector<int> adj[N];
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> v;
  map<long long int, long long int> cnt;
  long long int dis = 0;
  vector<long long int> numbers;
  for (long long int i = 0; i < n; i++) {
    long long int c;
    cin >> c;
    v.push_back(c);
    if (cnt[c] == 0) {
      dis++;
      numbers.push_back(0);
    }
    cnt[c]++;
  }
  if (n == 3) {
    if ((v[0] ^ v[1]) == v[2])
      cout << "Yes";
    else
      cout << "No";
    return;
  }
  if (dis > 3) {
    cout << "No";
    return;
  }
  if (dis == 3) {
    if (n % 3 != 0) {
      cout << "No";
      return;
    }
    if (cnt[numbers[0]] == (n / 3) && cnt[numbers[1]] == (n / 3) &&
        cnt[numbers[2]] == (n / 3)) {
      if ((numbers[0] ^ numbers[1]) == (numbers[2]))
        cout << "Yes";
      else
        cout << "No";
      return;
    } else {
      cout << "No";
      return;
    }
  } else if (dis == 2) {
    if (n % 2 == 0) {
      cout << "No";
    } else {
      if (cnt[0] == (n - 1) / 2)
        cout << "Yes";
      else
        cout << "No";
    }
    return;
  } else if (dis == 1) {
    if (cnt[0] == n)
      cout << "Yes";
    else
      cout << "No";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  int t = 0;
  while (t++ < T) {
    solve();
  }
}
