#include <bits/stdc++.h>
const long long INF = 0x3f3f3f3f;
using namespace std;
const long long MAXN = 100006;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long kc(long long a, long long b) {
  long long c = 1;
  while (b) {
    if (b & 1) c = (c * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return c;
}
bool cmp(double x, double y) { return x > y; }
int F[50003 * 3];
int Find(int a) { return F[a] < 0 ? a : F[a] = Find(F[a]); }
int same(int a, int b) {
  if (Find(a) == Find(b)) return 1;
  return 0;
}
int up1(int a, int b) {
  int x, y;
  x = Find(a);
  y = Find(b);
  if (x != y) F[x] = y;
  return 0;
}
long long s[100003];
long long sum;
int ss[100003];
int ss1[100003];
map<int, int> q;
int main() {
  int t;
  cin >> t;
  if (t % 3) {
    cout << "No\n";
    return 0;
  }
  int sum = 0;
  for (int i = 1; i <= t; i++) {
    cin >> s[i];
    if (!q[s[i]]) {
      q[s[i]] = ++sum;
      ss[sum] = s[i];
      ss1[sum]++;
    } else {
      ss1[q[s[i]]]++;
    }
  }
  if (sum > 3)
    cout << "No\n";
  else if (sum == 3) {
    if (ss[1] ^ ss[2] == ss[3] && ss1[1] == ss1[2] && ss1[2] == ss1[3])
      cout << "Yes\n";
    else
      cout << "No\n";
  } else if (sum == 2) {
    sort(ss1 + 1, ss1 + 3);
    if (2 * ss[1] == ss[2] && ss[1] * ss[1] == s[2])
      cout << "Yes\n";
    else
      cout << "No\n";
  } else if (sum == 1) {
    if (ss[1] == 0)
      cout << "Yes\n";
    else
      cout << "No\n";
  }
}
