#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a, ll b) {
  if (b > a) swap(a, b);
  ll r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}
int main() {
  int n;
  int sum = 0;
  bool flag = true;
  map<int, int> mp;
  cin >> n;
  int r = n % 3;
  if (r == 0) {
    for (int i = 0; i < (int)(n); i++) {
      int a;
      cin >> a;
      sum += a;
      mp[a]++;
    }
    int count = 0;
    int x, y, xy;
    for (auto p : mp) count++;
    if (count == 2) {
      int j = 0;
      for (auto p : mp) {
        if (j == 0) {
          if (p.second != n / 3) flag = false;
        } else if (j == 1) {
          if (p.second != 2 * n / 3) flag = false;
        }
        j++;
      }
    } else if (count == 3) {
      int j = 0;
      for (auto p : mp) {
        if (p.second != n / 3) flag = false;
        if (j == 0)
          x = p.first;
        else if (j == 1)
          y = p.first;
        else
          xy = p.first;
        j++;
      }
      if (x ^ y != xy) flag = false;
    } else {
      flag = false;
    }
    if (sum == 0) flag = true;
  } else {
    for (int i = 0; i < (int)(n); i++) {
      int a;
      cin >> a;
      if (a != 0) flag = false;
    }
  }
  if (flag)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
