#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1e9 + 7;
int main() {
  int N;
  cin >> N;
  vector<long long> key;
  vector<int> cnt(3, 0);
  for (int i = 0; i < N; i++) {
    long long a;
    cin >> a;
    bool flag = 1;
    int num;
    for (int j = 0; j < key.size(); j++) {
      if (key[j] == a) {
        num = j;
        flag = 0;
        break;
      }
    }
    if (flag) {
      num = key.size();
      key.push_back(a);
    }
    if (key.size() > 3) {
      cout << "No\n";
      return 0;
    }
    cnt[num]++;
  }
  if (key.size() == 1) {
    if (key[0] == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  } else if (key.size() == 2) {
    if (key[0] == 0) {
      if (cnt[0] * 2 == cnt[1]) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    } else if (key[1] == 0) {
      if (cnt[1] * 2 == cnt[0]) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    } else {
      cout << "No\n";
    }
  } else {
    if (key[0] ^ key[1] ^ key[2] == 0 && cnt[0] == cnt[1] && cnt[1] == cnt[2]) {
      cout << "Yes\n";
    } else {
      cout << "No\n";
    }
  }
}
