#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, cnt0 = 0;
  set<int> s;
  bool ans;
  cin >> N;
  for (int i = 0; i < (N); i++) {
    int a;
    cin >> a;
    s.insert(a);
    if (a == 0) cnt0++;
  }
  if (s.size() == 1) {
    set<int>::iterator it = s.begin();
    int x = *it;
    if (x == 0)
      ans = true;
    else
      ans = false;
  } else if (s.size() == 2) {
    set<int>::iterator it = s.begin();
    int x = *it;
    it++;
    int y = *it;
    if (N % 3 == 0 && cnt0 == N / 3)
      ans = true;
    else
      ans = false;
  } else if (s.size() == 3) {
    set<int>::iterator it = s.begin();
    int x = *it;
    it++;
    int y = *it;
    it++;
    int z = *it;
    if ((x ^ y) == z)
      ans = true;
    else
      ans = false;
  } else
    ans = false;
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}
