#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<long long> a(n);
  bool all_0 = true;
  for (int i = int(0); i < int(n); ++i) {
    cin >> a[i];
    if (a[i] != 0) {
      all_0 = false;
    }
  }
  if (all_0) {
    cout << "Yes" << endl;
  } else {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    map<long long, int> mp;
    for (int i = int(0); i < int(n); ++i) {
      mp[a[i]]++;
    }
    if (mp.size() == 3) {
      vector<long long> b;
      bool ok = true;
      for (auto p : mp) {
        b.push_back(p.first);
        if (p.second != n / 3) {
          ok = false;
        }
      }
      if (b[0] ^ b[1] ^ b[2] == 0 && ok) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else if (mp.size() == 2) {
      if (mp[0] == n / 3) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
