#include <bits/stdc++.h>
using namespace std;
int CalcSumOfDigit(int n);
int getDigit(int n);
string upper(string str);
string lower(string str);
class Combi {
 public:
  Combi();
  long long Combination(long long n, long long k);
  long long nPk_modp(long long n, long long k, long long p);

 private:
  vector<vector<long long>> memo;
  long long n_num;
  long long k_num;
  void Resize(long long n, long long k);
};
const int INF = 1e9;
int main() {
  long long n;
  cin >> n;
  map<long long, long long> m;
  for (int(i) = 0; (i) < (n); (i)++) {
    long long buf;
    cin >> buf;
    m[buf]++;
  }
  bool ans = false;
  if (int((m).size()) > 3) {
    ans = false;
  } else {
    if (int((m).size()) == 1) {
      if (m.begin()->first == 0) ans = true;
    } else {
      if (n % 3 == 0) {
        if (int((m).size()) == 2) {
          long long f_v = m.begin()->first;
          long long f_n = m.begin()->second;
          if (f_v == 0 && f_n == n / 3) ans = true;
        } else if (int((m).size()) == 3) {
          vector<long> v(3), num(3);
          long long j = 0;
          for (auto itr = m.begin(); itr != m.end(); ++itr) {
            v[j] = itr->first;
            num[j] = itr->second;
            ++j;
          }
          if ((num[0] == num[1] && num[1] == num[2] && num[2] == num[0]) &&
              (v[0] ^ v[2] == v[1]))
            ans = true;
        }
      }
    }
  }
  if (ans)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
int getDigit(int n) {
  int i = 1;
  while (1) {
    n = n / 10;
    if (n == 1) break;
    i++;
  }
  return i;
}
int CalcSumOfDigit(int n) {
  int s = 0;
  while (n) {
    s += n % 10;
    n = n / 10;
  }
  return s;
}
string upper(string str) {
  for (auto itr = str.begin(); itr != str.end(); itr++) {
    if (97 <= *itr && *itr <= 122) {
      *itr = *itr - 32;
    }
  }
  return str;
}
string lower(string str) {
  for (auto itr = str.begin(); itr != str.end(); itr++) {
    if (65 <= *itr && *itr <= 90) {
      *itr = *itr + 32;
    }
  }
  return str;
}
Combi::Combi() {
  n_num = -1;
  k_num = -1;
};
long long Combi::Combination(long long n, long long k) {
  Resize(n, k);
  long long ret;
  if (memo[n][k] != 0) {
    ret = memo[n][k];
  } else if (n == k || k == 0) {
    memo[n][k] = 1;
    ret = 1;
  } else {
    ret = Combination(n - 1, k - 1) + Combination(n - 1, k);
    memo[n][k] = ret;
  }
  return ret;
}
void Combi::Resize(long long n, long long k) {
  if (n_num <= n || k_num <= k) {
    n_num = (n + 1) * 2;
    k_num = (k + 1) * 2;
    memo.resize(n_num);
    for (auto itr = memo.begin(); itr != memo.end(); ++itr) {
      itr->resize(k_num);
    }
  }
}
long long Combi::nPk_modp(long long n, long long k, long long p) {
  long long ans = 1;
  for (long long i = k; i <= n; i++) {
    ans = (ans * i) % p;
  }
  return ans;
};
