#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int a[N];
int main() {
  int n;
  scanf("%d", &n);
  map<int, int> mp;
  vector<int> v;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    mp[a[i]]++;
    v.push_back(a[i]);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  if (v.size() >= 4) {
    puts("No");
  } else if (v.size() == 3) {
    int ok = (mp[a[0]] == mp[a[1]]);
    ok = (ok & (mp[a[1]] == mp[a[2]]));
    ok = (ok & ((a[0] ^ a[1]) == a[2]));
    if (ok) {
      puts("Yes");
    } else {
      puts("No");
    }
  } else if (v.size() == 2) {
    int ok = (mp[a[0]] == mp[a[1]]);
    ok = (ok & (a[0] == 0));
    if (ok) {
      puts("Yes");
    } else {
      puts("No");
    }
  } else if (v.size() == 1) {
    int ok = (a[0] == 0);
    if (ok) {
      puts("Yes");
    } else {
      puts("No");
    }
  }
}
