#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
const long long linf = 1LL << 62;
const int MAX = 510000;
long long dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};
long long dx[8] = {0, 0, 1, -1, 1, -1, -1, 1};
const double pi = acos(-1);
const double eps = 1e-7;
template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  if (a > b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {
  if (a < b) {
    a = b;
    return true;
  } else
    return false;
}
template <typename T>
inline void print(T &a) {
  for (int i = 0; i < (a.size()); i++) cout << a[i] << " ";
  cout << "\n";
}
template <typename T1, typename T2>
inline void print2(T1 a, T2 b) {
  cout << a << " " << b << "\n";
}
template <typename T1, typename T2, typename T3>
inline void print3(T1 a, T2 b, T3 c) {
  cout << a << " " << b << " " << c << "\n";
}
long long pcount(long long x) { return __builtin_popcountll(x); }
const int mod = 998244353;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  map<long long, long long> mp;
  for (int i = 0; i < (n); i++) mp[a[i]]++;
  if (n % 3 != 0) {
    if (mp.size() == 1 && mp[0] == n) {
      puts("Yes");
    } else {
      puts("No");
    }
  } else {
    if (mp.size() == 3) {
      long long exor = 0;
      long long num = -1;
      for (auto i : mp) {
        exor ^= i.first;
        if (num = -1)
          num = i.second;
        else {
          if (num != i.second) num = -2;
        }
      }
      if (exor == 0 && num >= 0)
        puts("Yes");
      else
        puts("No");
    } else {
      if (mp.find(0) == mp.end())
        puts("No");
      else {
        if (mp.size() == 2) {
          if (mp[0] == n / 3)
            puts("Yes");
          else
            puts("No");
        } else
          puts("No");
      }
    }
  }
}
