#include <bits/stdc++.h>
using namespace std;
long long newton(long long int a, long long int b) {
  if (a == b) return a;
  while (a != 0 && b != 0) {
    if (a > b) {
      b += a;
      a = b - a;
      b -= a;
    }
    b %= a;
  }
  return a;
}
struct UnionFind {
  vector<int> p;
  UnionFind(int N) : p(N) {
    for (int i = 0; i < N; i++) {
      p[i] = i;
    }
  }
  int root(int x) {
    if (p[x] == x) return x;
    return p[x] = root(p[x]);
  }
  void unite(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    if (rx == ry) return;
    p[rx] = ry;
  }
  bool issame(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};
long long div2mul_calc(long long a, long long b, long long m) {
  if (b == 0) {
    return 1;
  } else if (b % 2 == 0) {
    long long d = div2mul_calc(a, b / 2, m);
    return (d * d) % m;
  } else {
    return (a * div2mul_calc(a, b - 1, m)) % m;
  }
}
long long div2mul(long long n, long long mod) {
  return div2mul_calc(n, mod - 2, mod);
}
long long twoRow(long long a, long long b, long long mod) {
  long long ret = 1;
  for (long long i = 1; i <= a + b; ++i) {
    ret *= i;
    ret %= mod;
  }
  for (long long i = 1; i <= a; ++i) {
    ret *= div2mul(i, mod);
    ret %= mod;
  }
  for (long long i = 1; i <= b; ++i) {
    ret *= div2mul(i, mod);
    ret %= mod;
  }
  return ret;
}
int main() {
  int N;
  int K[3];
  int C[3] = {0};
  int pos = 0;
  int A[100010];
  int i, j, k;
  cin >> N;
  for (i = 0; i < N; ++i) {
    cin >> A[i];
  }
  k = 1;
  for (i = 0; i < N; ++i) {
    if (A[i] != 0) {
      k = 0;
      break;
    }
  }
  if (k == 1) {
    cout << "Yes" << endl;
  } else {
    for (i = 0; i < N; ++i) {
      k = 0;
      for (j = 0; j < pos; ++j) {
        if (K[j] == A[i]) {
          C[j]++;
          k = 1;
          break;
        }
      }
      if (k == 0) {
        if (pos == 3) {
          pos = 4;
          break;
        }
        K[pos] = A[i];
        C[pos] = 1;
        pos++;
      }
    }
    if (pos == 3 && C[0] == C[1] && C[0] == C[2] && K[0] ^ K[1] ^ K[2] == 0) {
      cout << "Yes" << endl;
    } else if (pos == 2 && ((C[0] * 2 == C[1] && K[0] == 0) ||
                            (C[0] == C[1] * 2 && K[1] == 0))) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}
