#include <bits/stdc++.h>
using namespace std;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using ll = long long;
using ul = unsigned long;
template <class T, class C>
void chmax(T& a, C b) {
  a > b ?: a = b;
}
template <class T, class C>
void chmin(T& a, C b) {
  a < b ?: a = b;
}
const int mod = 1e9 + 7;
int binary_search(VI& a, int key) {
  int left = 0, right = (int)a.size() - 1;
  while (right >= left) {
    int mid = left + (right - left) / 2;
    if (a[mid] == key)
      return mid;
    else if (a[mid] > key)
      right = mid - 1;
    else if (a[mid] < key)
      left = mid + 1;
  }
  return -1;
}
void printv(VI& v) {
  for (int i = (int)(0); i < (int)(v.size()); ++i) cout << v[i] << " ";
  cout << endl;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  PII p1 = make_pair(-1, 0);
  ;
  PII p2 = make_pair(-1, 0);
  ;
  PII p3 = make_pair(-1, 0);
  ;
  bool isNo = false;
  for (int i = (int)(0); i < (int)(n); ++i) {
    int a;
    cin >> a;
    if (p1.first == -1 || p1.first == a) {
      p1 = make_pair(a, ++p1.second);
      ;
    } else if (p2.first == -1 || p2.first == a) {
      p2 = make_pair(a, ++p2.second);
      ;
    } else if (p3.first == -1 || p3.first == a) {
      p3 = make_pair(a, ++p3.second);
      ;
    } else {
      isNo = "Yes";
    }
  }
  if (isNo) {
    cout << "No" << endl;
    return 0;
  }
  string ans = "No";
  if (p2.first == -1 && p3.first == -1) {
    if (p1.first == 0) ans = "Yes";
  } else if (p3.first == -1) {
    if (p1.first == 0) {
      if (p2.second * 3 == 2 * n) ans = "Yes";
    } else if (p2.first == 0) {
      if (p1.second * 3 == 2 * n) ans = "Yes";
    }
  } else {
    if (p1.first ^ p2.first ^ p3.first == 0) {
      if (p1.second * 3 == n && p2.second * 3 == n && p3.second * 3 == n)
        ans = "Yes";
    }
  }
  cout << ans << endl;
  return 0;
}
