#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n % 3 != 0) {
    int term = 0;
    for (int i = 0; i < n; i++) {
      if (a[i] != 0) {
        term = 1;
        break;
      }
    }
    if (term == 1) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
  if (n % 3 == 0) {
    int get = 2 * n / 3;
    int bit[30];
    for (int i = 0; i < n; i++) {
      int tmp = a[i];
      for (int j = 0; j < 30; j++) {
        bit[j] += tmp % 2;
        tmp = tmp / 2;
      }
    }
    int term = 0;
    for (int i = 0; i < 30; i++) {
      if (bit[i] != get) {
        term = 1;
        break;
      }
    }
    if (term == 1) {
      printf("No\n");
    } else {
      printf("Yes\n");
    }
  }
}
