#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  map<int, int> m;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    m[a[i]]++;
  }
  if (m[0] == n) {
    cout << "Yes";
    return 0;
  } else if (m[0] * 3 == n && m.size() == 2) {
    cout << "Yes";
    return 0;
  } else if (m.size() == 3) {
    vector<int> v(3);
    vector<int> v2(3);
    int i = 0;
    for (auto x : m) {
      v[i] = x.first;
      v2[i] = x.second;
      ++i;
    }
    if ((v2[0] == v2[1] && v2[1] == v2[2]) && (v[1] ^ v[2] ^ v[3]) == 0) {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}
