#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 100;
int n;
int a[N];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  if (n == 3) {
    if (a[1] ^ a[2] == a[3] && a[2] ^ a[3] == a[1] && a[1] ^ a[3] == a[2]) {
      cout << "Yes";
      return 0;
    } else {
      cout << "No";
      return 0;
    }
  }
  int cnt0 = 0;
  set<int> st;
  for (int i = 1; i <= n; i++) {
    if (a[i] != 0)
      st.insert(a[i]);
    else
      cnt0++;
  }
  if (cnt0 * 3 == n && st.size() == 1) {
    cout << "Yes";
    return 0;
  } else if (st.size() == 0) {
    cout << "Yes";
    return 0;
  } else {
    cout << "No";
    return 0;
  }
}
