#include <bits/stdc++.h>
using namespace std;
int a[4], me[4];
int main() {
  int n, i, num, cnt = 0;
  cin >> n;
  a[1] = a[2] = a[3] = -1;
  for (i = 1; i <= n; i++) {
    cin >> num;
    if (num == a[1])
      me[1]++;
    else if (num == a[2])
      me[2]++;
    else if (num == a[3])
      me[3]++;
    else if (num != a[1] && num != a[2] && num != a[3]) {
      a[++cnt] = num;
      me[cnt] = 1;
    }
    if (cnt > 3) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (cnt == 3 && a[1] ^ a[2] == a[3] && a[2] ^ a[3] == a[1] &&
      a[1] ^ a[3] == a[2] && me[1] % 3 == 0 && me[2] % 3 == 0 && me[3] % 3 == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
