#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  if (N % 3) {
    int a;
    cin >> a;
    if (a != 0) {
      cout << "No" << endl;
      return 0;
    }
    for (int i = 1; i < N; ++i) {
      int tmp;
      cin >> tmp;
      if (a != tmp) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  map<int, int> Map;
  for (int i = 0; i < N; ++i) {
    int a;
    cin >> a;
    ++Map[a];
  }
  vector<int> B, Num;
  for (auto &p : Map) {
    B.push_back(p.first);
    Num.push_back(p.second);
  }
  if (Num.size() > 3) {
    cout << "No" << endl;
    return 0;
  }
  if (Num.size() == 3) {
    if (Num[0] != Num[1] || Num[1] != Num[2] || Num[2] != Num[0]) {
      cout << "No" << endl;
      return 0;
    }
    if (B[0] ^ B[1] == B[2])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (Num.size() == 2) {
    if (Num[0] > Num[1]) {
      swap(Num[0], Num[1]);
      swap(B[0], B[1]);
    }
    if (B[0] != 0) {
      cout << "No" << endl;
      return 0;
    }
    if (Num[0] * 2 == Num[1]) {
      cout << "Yes" << endl;
    } else
      cout << "No" << endl;
    return 0;
  }
  if (Num.size() == 1) {
    if (B[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
  return 0;
}
