#include <bits/stdc++.h>
using namespace std;
int d[1010][1010];
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int h, w;
char board[1010][1010];
bool check(int i, int j) {
  return (i >= 0) && (i <= h) && (j >= 0) && (j <= w) && (board[i][j] == '.');
}
int number[100010] = {0};
int main(void) {
  int n, sum = 0;
  cin >> n;
  vector<int> a(n);
  set<int> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
    number[a[i]]++;
    s.insert(a[i]);
  }
  if (sum == 0) {
    cout << "Yes" << endl;
    return 0;
  }
  if (s.size() == 3) {
    sum = 0;
    if (n % 3 != 0) {
      cout << "No" << endl;
      return 0;
    }
    for (auto itr = s.begin(); itr != s.end(); ++itr) {
      sum ^= (*itr);
    }
    if (sum == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (s.size() == 2) {
    sum = 0;
    int v[2] = {0};
    for (auto itr = s.begin(); itr != s.end(); ++itr) {
      v[sum] = number[*itr];
      sum++;
    }
    if (((v[0] == n / 3) && (v[1] == 2 * n / 3)) ||
        ((v[0] == n / 3) && (v[1] == 2 * n / 3))) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}
