#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
int n;
int a[100010];
map<int, int> m;
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> n;
  bool all0 = 1;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    a[i] = x;
    if (x) all0 = 0;
    if (m.count(x))
      m[x]++;
    else
      m.insert(make_pair(x, 1));
  }
  if (all0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (n % 3) {
    cout << "No" << endl;
    return 0;
  }
  if (m.size() == 1) {
    cout << "Yes" << endl;
  } else if (m.size() == 2) {
    auto ite = m.begin();
    int a = ite->first;
    int b = ite->second;
    ite++;
    int c = ite->first;
    int d = ite->second;
    if (d == b * 2 && a == 0) {
      cout << "Yes" << endl;
    } else if (b == d * 2 && c == 0) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
  } else {
    auto ite = m.begin();
    int a = ite->second;
    int d = ite->first;
    ite++;
    int b = ite->second;
    int e = ite->first;
    ite++;
    int c = ite->second;
    int f = ite->first;
    if (a == b && b == c && d ^ e ^ f == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}
