#include <bits/stdc++.h>
using namespace std;
const double PI = 2 * acos(.0);
const int INF = 0x3f3f3f3f;
const long long LLINF = 1000000000000000005LL;
;
const long long MOD = (long long)(1e9) + 7;
void _mod(long long& x) { x = ((((x) % (MOD)) + (MOD)) % (MOD)); }
const double EPS = 1e-10;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
  std::fill((T*)array, (T*)(array + N), val);
}
template <typename T>
ostream& operator<<(ostream& os, const vector<T> V) {
  for (auto v : V) os << v << " ";
  return os;
}
template <typename T>
ostream& operator<<(ostream& os, const set<T> V) {
  for (auto v : V) os << v << " ";
  return os;
}
class AXORCircle {
 public:
  map<int, int> M;
  void solve(std::istream& cin, std::ostream& cout) {
    int N;
    cin >> N;
    for (__typeof(N) i = 0, _len = (N); i < (_len); i += 1) {
      int t;
      cin >> t;
      M[t]++;
    }
    if (M.count(0)) {
      if (M.size() == 2 && N % 3 == 0 && M[0] == N / 3)
        cout << "Yes";
      else
        cout << "No";
    } else {
      auto it = M.begin();
      if (M.size() == 3 && it->second == (++it)->second &&
          it->second == ((++it)->second))
        cout << "Yes";
      else
        cout << "No";
    }
  }
};
int main() {
  AXORCircle solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  in.tie(0);
  ios::sync_with_stdio(0);
  out << fixed << setprecision(20);
  solver.solve(in, out);
  return 0;
}
