#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")
using namespace std;
template <class T>
void print(vector<T> s) {
  for (T x : s) cout << x << " ";
  cout << endl;
}
int main() {
  srand(17);
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<int> s(n);
  map<int, int> cnt;
  set<int> diff;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    diff.insert(s[i]);
    cnt[s[i]]++;
  }
  if (n % 3 != 0) {
    int t = *(diff.begin());
    if (diff.size() == 1 && t == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
    return 0;
  }
  if (diff.size() == 3) {
    int cur = 0;
    for (auto x : cnt) {
      cur ^= x.first;
      if (x.second != n / 3) {
        cout << "No\n";
        return 0;
      }
    }
    if (cur == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
    return 0;
  }
  if (diff.size() == 1) {
    int t = *(diff.begin());
    if (t == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  } else
    cout << "No\n";
  return 0;
}
