#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long MOD2 = 998244353;
const long long MOD3 = 1812447359;
const long long INF = 1ll << 62;
const double PI = 2 * asin(1);
void yes() { printf("yes\n"); }
void no() { printf("no\n"); }
void Yes() { printf("Yes\n"); }
void No() { printf("No\n"); }
void YES() { printf("YES\n"); }
void NO() { printf("NO\n"); }
int N, cnt;
vector<int> used;
long long A[int(1e5 + 5)], ans;
map<int, int> visited;
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) {
    cin >> A[i];
    if (visited[A[i]] == 0) {
      used.push_back(A[i]);
      cnt++;
    }
    visited[A[i]]++;
  }
  if (cnt >= 4) {
    No();
    return 0;
  }
  if (cnt == 1) {
    if (used[0] == 0)
      Yes();
    else
      No();
    return 0;
  }
  if (cnt == 3) {
    int num = 0;
    for (int i = 0; i < 3; i++) {
      num ^= used[i];
    }
    if (num != 0) {
      No();
    } else {
      if (visited[used[0]] == visited[used[1]] &&
          visited[used[1]] == visited[used[2]])
        Yes();
      else
        No();
    }
    return 0;
  }
  for (int i = 0; i < 2; i++) {
    if (used[i] == 0) continue;
    if (visited[used[i]] != visited[used[0]] * 2) {
      No();
      return 0;
    }
  }
  Yes();
  return 0;
}
