#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
inline int Scan() {
  int x = 0;
  int f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
map<int, int> mp;
int main() {
  int n, x;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> x;
    ++mp[x];
  }
  if (n % 3 != 0) {
    if ((int)mp.size() == 1 && (mp.begin())->first == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    if ((int)mp.size() > 3)
      cout << "No" << endl;
    else {
      vector<int> a;
      for (auto i : mp) {
        if (i.second % (n / 3) != 0) {
          cout << "No" << endl;
          return 0;
        } else {
          for (int j = 0; j < i.second; j += n / 3) a.push_back(i.first);
        }
      }
      if (a[0] ^ a[1] == a[2])
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
  return 0;
}
