#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int64_t N;
  cin >> N;
  vector<int64_t> a(N);
  for (int64_t i = 0; i < N; i++) cin >> a[i];
  map<int64_t, int64_t> bugget;
  for (auto e : a) {
    bugget[e]++;
  }
  vector<int64_t> buggetv, num;
  for (auto e : bugget) {
    buggetv.push_back(e.second);
    num.push_back(e.first);
  }
  if (buggetv.size() > 3)
    cout << "No" << endl;
  else if (buggetv.size() == 3) {
    if (buggetv[0] == buggetv[1] && buggetv[1] == buggetv[2] &&
        num[0] ^ num[1] ^ num[2] == 0 && num[0] != num[1] && num[1] != num[2] &&
        num[2] != num[0]) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else if (buggetv.size() == 2) {
    if (buggetv[0] > buggetv[1]) {
      reverse(buggetv.begin(), buggetv.end());
      reverse(num.begin(), num.end());
    }
    if (buggetv[0] * 2 == buggetv[1] && num[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if (num[0] == 0) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  }
}
