#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  os << "{";
  for (int i = 0; i < (int)v.size(); i++) {
    if (i) os << ", ";
    os << v[i];
  }
  os << "}";
  return os;
}
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
int main() {
  map<int, int> freq;
  int n;
  scanf("%d", &(n));
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &(x));
    freq[x]++;
  }
  auto mn = freq.begin()->first;
  int s = ((int)(freq).size());
  if ((((int)(freq).size()) == 1 && mn) || ((int)(freq).size()) > 3) {
    printf("No\n");
    return 0;
  }
  if (s == 1) {
    printf("No\n");
    return 0;
  }
  if (s == 2) {
    if (mn != 0) {
      printf("No\n");
      return 0;
    }
    auto it = freq.begin();
    int a = it->second;
    it++;
    int b = it->second;
    if (b != 2 * a) {
      printf("No\n");
      return 0;
    }
    printf("Yes\n");
    return 0;
  }
  auto it = freq.begin();
  int a = it->second, x = it->first;
  it++;
  int b = it->second, y = it->first;
  it++;
  int c = it->second, z = it->first;
  printf((a == b && b == c && c == a && (x ^ y) == z) ? "Yes\n" : "No\n");
}
