#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[100002];
  map<int, int> mp;
  int num[3] = {-1, -1, -1};
  int count[3]{0};
  int now = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    mp[a[i]]++;
  }
  for (auto itr = mp.begin(); itr != mp.end(); itr++) {
    num[now] = itr->first;
    count[now] = itr->second;
    now++;
  }
  if (n % 3 == 0 && count[0] == count[1] && count[1] == count[2] &&
      count[0] == n / 3) {
    if ((num[0] ^ num[1] ^ num[2]) == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (n % 3 == 0 && count[0] + count[1] == n &&
             count[0] == count[1] * 2) {
    if (num[1] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (n % 3 == 0 && count[0] + count[1] == n &&
             count[1] == count[0] * 2) {
    if (num[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else
    cout << "No" << endl;
}
