#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  if (n % 3 == 0) {
    map<int, int> mp;
    for (int i = 0; i < (n); ++i) mp[a[i]]++;
    if (mp.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
    int m = 0;
    for (auto p : mp) {
      int cnt = p.second;
      if (cnt % (n / 3) != 0) {
        cout << "No" << endl;
        return 0;
      }
      m ^= p.first;
    }
    if (m != 0) {
      cout << "No" << endl;
      return 0;
    }
    cout << "Yes" << endl;
  } else {
    set<int> s;
    for (int i = 0; i < (n); ++i) s.insert(a[i]);
    if (s.size() == 1) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
