#include <bits/stdc++.h>
using namespace std;
long double eps = 1.0E-14;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return gcd(a, b) * (a / gcd(a, b)) * (b / gcd(a, b));
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> v;
  long long tmp;
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> tmp;
    v.emplace_back(tmp);
  }
  sort((v).begin(), (v).end());
  vector<long long> vv;
  vv = v;
  vv.erase(unique(vv.begin(), vv.end()), vv.end());
  ;
  long long a[((int)(vv).size())];
  memset((a), 0, sizeof(a));
  a[0]++;
  long long idx = 0;
  for (long long i = 1; i <= (long long)(n - 1); i++) {
    if (v[i - 1] == v[i])
      a[idx]++;
    else
      a[++idx]++;
  }
  string ans = "No";
  if (((int)(vv).size()) == 1) {
    if (vv[0] == 0) ans = "Yes";
  } else if (((int)(vv).size()) == 2) {
    if (vv[0] == 0 && a[0] * 3 == n && a[1] * 3 == 2 * n) ans = "Yes";
  } else if (((int)(vv).size()) == 3) {
    if (vv[0] ^ vv[1] ^ vv[2] == 0 && a[0] * 3 == n && a[1] * 3 == n &&
        a[2] * 3 == n)
      ans = "Yes";
  }
  cout << ans << endl;
  return 0;
}
