#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  vector<long long int> a;
  cin >> n;
  map<long long int, long long int> m;
  for (int i = 0; i < n; ++i) {
    long long int ai;
    cin >> ai;
    m[ai]++;
    a.push_back(ai);
  }
  if (n % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  if (m.size() == 3) {
    long long int keys[3];
    long long int nums[3];
    int ptr = 0;
    for (auto it = m.begin(); it != m.end(); ++it) {
      keys[ptr] = it->first;
      nums[ptr] = it->second;
      ptr++;
    }
    if (keys[0] == (keys[1] ^ keys[2]) && nums[0] == nums[1] &&
        nums[1] == nums[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (m.size() == 1) {
    long long int key;
    long long int num;
    int ptr = 0;
    for (auto it = m.begin(); it != m.end(); ++it) {
      key = it->first;
      num = it->second;
      ptr++;
    }
    if (key == 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else if (m.size() == 2) {
    long long int keys[2];
    long long int nums[2];
    int ptr = 0;
    for (auto it = m.begin(); it != m.end(); ++it) {
      keys[ptr] = it->first;
      nums[ptr] = it->second;
      ptr++;
    }
    if (keys[0] == 0) {
      if (nums[1] / 2 == nums[0]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (keys[1] == 0) {
      if (nums[0] / 2 == nums[1]) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
