#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b);
long long int lcm(long long int x, long long int y);
long long int bur(long long int N, long long int X);
long long comb(int n, int r);
bool IsPrime(int num);
bool dp[110][10010];
class UnionFind;
class UnionFind {
 public:
  vector<int> Parent;
  UnionFind(int N) { Parent = vector<int>(N, -1); }
  int root(int A) {
    if (Parent[A] < 0) return A;
    return Parent[A] = root(Parent[A]);
  }
  int size(int A) { return -Parent[root(A)]; }
  int connect(int A, int B) {
    A = root(A);
    B = root(B);
    if (A == B) {
      return false;
    }
    if (size(A) < size(B)) swap(A, B);
    Parent[A] += Parent[B];
    Parent[B] = A;
    return true;
  }
};
int main(void) {
  int N = 0;
  long long int A = 0;
  long long int B = 0;
  long long int C = 0;
  long long int D = 0;
  long long int E = 0;
  long long int W = 0;
  long long int H = 0;
  long long int b[9] = {1, 7, 4, 5, 3, 2, 9, 6, 8};
  long long int d[10] = {};
  string S, T, U[52];
  char fi[50], fv[50];
  long long int count = 0;
  double count2 = 0;
  long long int min = 3000;
  long long int max = 1;
  long long int dist1 = 0;
  long long int dist2 = 0;
  long long int dist3 = 0;
  long long int now = 0;
  int tmax = 10000;
  int tmax2 = 0;
  bool start = false;
  float all = 0, all2 = 0, all3 = 0;
  long long int amr = 0;
  char col = NULL;
  cin >> N;
  vector<long long int> la(N);
  long long int keep = 0;
  for (long long int i = (0); i < (N); ++i) {
    cin >> la[i];
  }
  sort(la.begin(), la.end());
  if (N % 3 != 0) {
    cout << "No" << endl;
    return 0;
  } else {
    long long int s0 = 0, s1 = 0;
    amr = la[0];
    long long int aaa[3] = {};
    long long int num[3] = {};
    num[0] = la[0];
    for (long long int i = (0); i < (N); ++i) {
      if (amr != la[i]) {
        count++;
        num[count] = la[i];
        if (count == 3) {
          cout << "No" << endl;
          return 0;
        }
        aaa[count]++;
        amr = la[i];
      } else {
        aaa[count]++;
      }
    }
    if (count == 2) {
      if (num[1] != (num[0] ^ num[2])) {
        cout << "No" << endl;
        return 0;
      }
    }
    if ((aaa[0] == aaa[1]) && (aaa[1] == aaa[2]))
      cout << "Yes" << endl;
    else if (count == 1 && la[0] == 0 && aaa[0] * 2 == aaa[1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
long long int bur(long long int N, long long int X) {
  long long int pan = 1;
  long long int pat = 1;
  long long int burg = 0;
  if (X > burg) {
    if (N == 0) return pat;
    burg += pan;
    burg += bur(N - 1, X);
    burg += pat;
    burg += bur(N - 1, X);
    burg += pan;
  }
  return burg;
}
long long int gcd(long long int a, long long int b) {
  if (a < b) {
    long long int tmp = a;
    a = b;
    b = tmp;
  }
  long long int x = b;
  long long int y = a;
  long long int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return y / b * x;
}
bool IsPrime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;
  double sqrtNum = sqrt(num);
  for (int i = 3; i <= sqrtNum; i += 2) {
    if (num % i == 0) {
      return false;
    }
  }
  return true;
}
long long int lcm(long long int x, long long int y) {
  if (x == 0 || y == 0) {
    return 0;
  }
  return (x * y / gcd(x, y));
}
long long comb(int n, int r) {
  std::vector<std::vector<long long>> v(n + 1,
                                        std::vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v[n][r];
}
