#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N);
  for (auto& a : A) {
    cin >> a;
  }
  if (N % 3 == 0) {
    map<int, int> dict;
    for (auto a : A) {
      dict[a] += 1;
    }
    if (dict.count(0) && dict[0] == N) {
      cout << "Yes" << endl;
    } else if (dict.count(0) && dict.size() == 2 && dict[0] == N / 3) {
      cout << "Yes" << endl;
    } else if (dict.size() == 3) {
      bool flag = true;
      int x = 1;
      for (auto& p : dict) {
        x ^= p.first;
        if (p.second == N / 3) {
          continue;
        } else {
          flag = false;
        }
      }
      if (x == 1 && flag) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }
}
