#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int a[100010] = {0};
  int taf = 0;
  cin >> N;
  if (N == 1) cout << "Yes" << endl;
  if (N == 2)
    cout << "No" << endl;
  else if (N >= 3) {
    for (int i = 0; i < N; i++) cin >> a[i];
    sort(a, a + N);
    int b[4][2] = {0};
    for (int i = 0; i < N; i++) {
      if (a[i] == 0) {
        b[0][1] += 1;
      } else if (a[i] != b[0][0] && b[1][0] == 0) {
        b[1][0] = a[i];
        b[1][1] = 1;
      } else if (a[i] == b[1][0])
        b[1][1] += 1;
      else if (a[i] != b[1][0] && b[2][0] == 0) {
        b[2][0] = a[i];
        b[2][1] = 1;
      } else if (a[i] == b[2][0])
        b[2][1] += 1;
      else if (a[i] != b[2][0] && b[3][0] == 0) {
        b[3][0] = a[i];
        b[3][1] = 1;
      } else if (a[i] == b[3][0])
        b[3][1] += 1;
      else
        taf = 1;
    }
    if (b[0][1] == 0) {
      if (b[1][1] == b[2][1] && b[2][1] == b[3][1])
        taf = taf;
      else
        taf = 1;
      int c = b[1][0] ^ b[2][0];
      if (c != b[3][0]) taf = 1;
    } else if (b[0][0] == 0) {
      if (b[2][0] == 0) {
        int c = b[0][1] * 2;
        if (c != b[1][1]) taf = 1;
      } else if (b[3][0] == 0)
        taf = 1;
      else {
        if (b[0][1] == b[1][1] && b[1][1] == b[2][1] && b[2][1] == b[3][1])
          taf = taf;
        else
          taf = 1;
        int c = b[1][0] ^ b[2][0];
        if (c != b[3][0]) taf = 1;
        if (b[1][0] == 1) taf = 0;
      }
    }
    if (taf == 1)
      cout << "No" << endl;
    else if (taf == 0)
      cout << "Yes" << endl;
  }
}
