#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long double Pi = acos(-1);
using P = pair<long long, long long>;
long long gcd(long long a, long long b) {
  if (a % b == 0) {
    return b;
  } else {
    return gcd(b, a % b);
  }
}
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
long long pow(long long x, long long y) {
  long long tmp = x, res = 1;
  while (y) {
    if (y % 2) {
      res = res * tmp % MOD;
    }
    y >>= 1;
    tmp = tmp * tmp % MOD;
  }
  return res;
}
long long nature(long long a) {
  if (a >= 0) {
    return (a);
  } else {
    return (-1 * a);
  }
}
long long prime(long long a) {
  if (a == 2) {
    return 1;
  } else if (a % 2 == 0 || a == 1) {
    return 0;
  }
  for (long long i = 3; i * i <= a; i += 2) {
    if (a % i == 0) {
      return 0;
    }
  }
  return 1;
}
int main() {
  long long N, a, rock = 0, ans = 0;
  cin >> N;
  unordered_map<long long, long long> mp;
  for (long long i = 0; i < N; i++) {
    cin >> a;
    mp[a]++;
    if (a == 0) {
      rock++;
    }
  }
  if (N % 3 != 0 && rock != N) {
    cout << "No" << endl;
    return 0;
  }
  if (rock == N) {
    cout << "Yes" << endl;
    return 0;
  }
  if (rock == N / 3 && mp.size() == 2) {
    cout << "Yes" << endl;
    return 0;
  }
  if (mp.size() == 3) {
    for (auto itr = mp.begin(); itr != mp.end(); itr++) {
      ans ^= (itr->first);
    }
    if (ans == 0) {
      cout << "Yes" << endl;
      return 0;
    } else {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
