#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
struct mint {
  int n;
  mint(int n_ = 0) : n(n_) {}
};
mint operator-(mint a) { return -a.n + MOD * (a.n != 0); }
mint operator+(mint a, mint b) {
  int x = a.n + b.n;
  return x - (x >= MOD) * MOD;
}
mint operator-(mint a, mint b) {
  int x = a.n - b.n;
  return x + (x < 0) * MOD;
}
mint operator*(mint a, mint b) { return (long long)a.n * b.n % MOD; }
mint &operator+=(mint &a, mint b) { return a = a + b; }
mint &operator-=(mint &a, mint b) { return a = a - b; }
mint &operator*=(mint &a, mint b) { return a = a * b; }
istream &operator>>(istream &i, mint &a) { return i >> a.n; }
ostream &operator<<(ostream &o, mint a) { return o << a.n; }
vector<mint> F_{1, 1}, R_{1, 1}, I_{0, 1};
void check_fact(int n) {
  for (int i = I_.size(); i <= n; i++) {
    I_.push_back(I_[MOD % i] * (MOD - MOD / i));
    F_.push_back(F_[i - 1] * i);
    R_.push_back(R_[i - 1] * I_[i]);
  }
}
mint I(int n) {
  check_fact(abs(n));
  return n >= 0 ? I_[n] : -I_[n];
}
mint F(int n) {
  check_fact(n);
  return n < 0 ? 0 : F_[n];
}
mint R(int n) {
  check_fact(n);
  return n < 0 ? 0 : R_[n];
}
mint C(int n, int r) { return F(n) * R(n - r) * R(r); }
mint P(int n, int r) { return F(n) * R(n - r); }
mint H(int n, int r) { return n == 0 ? (r == 0) : C(n + r - 1, r); }
template <typename T>
T gcd(T x, T y) {
  if (y == 0)
    return x;
  else
    return gcd(y, x % y);
}
template <typename T>
T lcm(T x, T y) {
  return (x / gcd(x, y)) * y;
}
template <typename T>
T ceil(T x, T y) {
  return (x + (y - 1)) / y;
}
long long int N;
long long int t[100000];
vector<long long int> a;
int main(void) {
  cin >> N;
  for (int i = (0); i < (N); i++) {
    scanf("%lld", &t[i]);
    a.push_back(t[i]);
  }
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  }
  long long int c = 0;
  long long int odd = 0;
  long long int even = 0;
  for (int i = (0); i < (N); i++) {
    c ^= a[i];
    if (a[i] % 2 == 0)
      even += 1;
    else
      odd += 1;
  }
  if (c != 0 or odd != even * 2) {
    cout << "No" << endl;
    return 0;
  }
  long long int count = 0;
  long long int n = N;
  while (n) {
    count++;
    n /= 2;
  }
  odd = 0;
  even = 0;
  for (long long int r = 1; r < count; r++) {
    for (int i = (0); i < (N); i++) {
      if ((a[i] >> r) % 2 == 0)
        even += 1;
      else
        odd += 1;
    }
    if (odd != even * 2) {
      cout << "No" << endl;
      return 0;
    }
  }
  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());
  if (a.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (a.size() == 2) {
    cout << "Yes" << endl;
    return 0;
  }
  long long int first = 0;
  long long int second = 0;
  long long int third = 0;
  for (int i = (0); i < (N); i++) {
    if (a[0] == t[i])
      first++;
    else if (a[1] == t[i])
      second++;
    else
      third++;
  }
  if (first != second or second != third) {
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  return 0;
}
