#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline void add(T& a, T b) {
  a = ((a + b) % 1000000007 + 1000000007) % 1000000007;
};
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const double PI = acos(-1.0);
const double EPS = 1e-10;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  map<int, int> mp;
  string ans = "No";
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (n % 3 != 0) {
    if (mp.size() == 1) {
      for (auto x : mp)
        if (x.first == 0) ans = "Yes";
    }
  } else {
    if (mp.size() == 3) {
      int Xor = 0;
      for (auto x : mp) {
        Xor ^= x.first;
        if (3 * x.second != n) {
          ans = "No";
          break;
        }
      }
      if (Xor == 0) ans = "Yes";
    } else if (mp.size() == 2) {
      int zero = 0, num = 0;
      for (auto x : mp) {
        if (x.first == 0)
          zero = x.second;
        else
          num = x.second;
      }
      if (3 * zero == n && 3 * num == 2 * n) ans = "Yes";
    }
  }
  cout << ans << endl;
}
