#include <bits/stdc++.h>
using namespace std;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
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;
}
using ll = long long;
using P = pair<ll, ll>;
constexpr ll mod = 1e9 + 7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  unordered_map<int, int> mp;
  for (int i = 0; i < (int)(n); i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 3) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    vector<int> vec;
    for (auto e : mp) {
      vec.push_back(e.first);
      if (e.second != n / 3) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (vec[0] ^ vec[1] == vec[2]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (mp.size() == 2) {
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    bool flag1 = false;
    bool flag2 = false;
    for (auto e : mp) {
      if (e.first == 0 && e.second == n / 3) {
        flag1 = true;
      }
      if (e.first != 0 && e.second == n * 2 / 3) {
        flag2 = true;
      }
    }
    if (flag1 && flag2) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
    return 0;
  }
  if (mp.size() == 1) {
    for (auto e : mp) {
      if (e.first == 0) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
      return 0;
    }
  }
}
