#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  long long int num[3][2];
  for (int i = 0; i < 3; i++) {
    num[i][0] = -1;
    num[i][1] = 0;
  }
  for (int i = 0; i < n; i++) {
    bool flag = false;
    long long int tmp;
    cin >> tmp;
    for (int j = 0; j < 3; j++) {
      if (num[j][0] == -1) {
        num[j][0] = tmp;
        num[j][1]++;
        flag = true;
        break;
      } else if (num[j][0] == tmp) {
        num[j][1]++;
        flag = true;
        break;
      }
    }
    if (flag) continue;
    cout << "No" << endl;
    return 0;
  }
  if (num[1][0] == -1 && num[2][0] == -1 && num[0][0] == 0)
    cout << "Yes" << endl;
  else if (n % 3 == 0 && num[2][0] == -1) {
    if (num[0][0] == 0 && num[0][1] == 2 * num[1][1])
      cout << "Yes" << endl;
    else if (num[1][0] == 0 && num[1][1] == 2 * num[0][1])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (num[0][0] ^ num[1][0] ^ num[2][0] == 0 && num[0][1] == num[1][1] &&
             num[1][1] == num[2][1])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
