#include <bits/stdc++.h>
using namespace std;
map<int, int> mp;
vector<int> v;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int tmp;
    scanf("%d", &tmp);
    mp[tmp]++;
    if (mp[tmp] == 1) v.push_back(tmp);
  }
  if (v.size() != 3) {
    printf("No");
    return 0;
  }
  if (mp[v[0]] != mp[v[1]] || mp[v[2]] != mp[v[1]]) {
    printf("No");
    return 0;
  }
  if ((v[0] ^ v[2]) != v[1] || (v[0] ^ v[1]) != v[2] || (v[1] ^ v[2]) != v[0]) {
    printf("No");
    return 0;
  } else {
    printf("Yes");
    return 0;
  }
  return 0;
}
