#include <bits/stdc++.h>
using namespace std;
template <typename T>
bool setmin(T& a, T b) {
  if (b < a) {
    a = b;
    return true;
  } else {
    return false;
  }
}
template <typename T>
bool setmax(T& a, T b) {
  if (b > a) {
    a = b;
    return true;
  } else {
    return false;
  }
}
template <typename T>
bool setmineq(T& a, T b) {
  if (b <= a) {
    a = b;
    return true;
  } else {
    return false;
  }
}
template <typename T>
bool setmaxeq(T& a, T b) {
  if (b >= a) {
    a = b;
    return true;
  } else {
    return false;
  }
}
long long signed int mo(long long signed int a, long long signed int b) {
  assert(b > 0);
  a %= b;
  if (a < 0) {
    a += b;
  }
  return a;
}
long long signed int fl(long long signed int a, long long signed int b) {
  assert(b > 0);
  return (a > 0 ? a / b : (a - b + 1) / b);
}
long long signed int ce(long long signed int a, long long signed int b) {
  assert(b > 0);
  return (a < 0 ? a / b : (a + b - 1) / b);
}
template <typename T>
T gcd(T a, T b) {
  return (b == 0 ? a : gcd(b, a % b));
}
template <typename T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
vector<pair<T, long long signed int>> cc(vector<T> v) {
  vector<pair<T, long long signed int>> a;
  for (long long signed int i = (0); i < (v.size()); ++i) {
    if (i == 0 || v[i] != v[i - 1]) {
      a.emplace_back(v[i], 1);
    } else {
      a.back().second++;
    }
  }
  return a;
}
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (long long signed int i = (0); i < (n); ++i) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  auto v = cc(a);
  bool ans = false;
  if (n % 3 != 0) {
    ans = (static_cast<int>(v.size()) == 1 && v[0].first == 0);
  } else {
    if (static_cast<int>(v.size()) == 3) {
      ans = (v[0].second == n / 3 && v[1].second == n / 3 &&
             v[0].first ^ v[1].first == v[2].first);
    }
    if (static_cast<int>(v.size()) == 2) {
      ans = (v[0].second == 2 * n / 3 && v[0].first == 0);
    }
  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
