#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  map<int, int> mp;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    mp[a]++;
  }
  if (mp.size() == 1 and mp.begin()->first == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  if (mp.size() == 2) {
    vector<pair<int, int>> a;
    for (auto p : mp) a.push_back({p.first, p.second});
    if ((a[0].first == 0 and a[0].second * 3 == n) or
        (a[1].first == 0 and a[1].second * 3 == n))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (mp.size() != 3) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
    return 0;
    vector<pair<int, int>> a;
    for (auto p : mp) a.push_back({p.first, p.second});
    if (a[0].second * 3 == n and a[1].second * 3 == n and
        a[2].second * 3 == n and (a[0].first ^ a[1].first ^ a[2].first == 0))
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
