#include <bits/stdc++.h>
using namespace std;
int n, x;
map<int, int> f;
int nr, v[100001], nr1, nr2, nr3;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> v[i];
    if (f.count(v[i]) == 0) nr++;
    f[v[i]]++;
  }
  if (nr == 3) {
    int fr = f[v[1]];
    for (int i = 1; i <= n; i++)
      if (f[v[i]] != fr) {
        cout << "No";
        return 0;
      }
    for (int i = 1; i <= n; i++) {
      if (nr1 == 0) {
        nr1 = v[i];
        continue;
      }
      if (nr2 == 0 && v[i] != nr1) {
        nr2 = v[i];
        continue;
      }
      if (nr3 == 0 && v[i] != nr1 && v[i] != nr2) {
        nr3 = v[i];
        continue;
      }
    }
    if ((nr1 ^ nr2) == nr3)
      cout << "Yes";
    else
      cout << "No";
    return 0;
  }
  cout << "No";
  return 0;
}
