#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int n;
  cin >> n;
  int three[3], count[3] = {};
  long long int a[100010];
  for (int i = 0; i < 3; i++) three[i] = -1;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n % 3 != 0) {
    for (int i = 0; i < n; i++) {
      if (a[i] != 0) {
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  for (int i; i < n; i++) {
    bool next = false;
    for (int j = 0; j < 3; j++) {
      if (a[i] == three[j]) {
        count[j]++;
        next = true;
        break;
      }
    }
    if (next) continue;
    for (int j = 0; j < 3; j++) {
      if (three[j] == -1) {
        three[j] = a[i];
        count[j]++;
        next = true;
        break;
      }
    }
    if (!next) {
      cout << "No" << endl;
      return 0;
    }
  }
  if (count[1] == 0 and count[2] == 0) {
    if (a[0] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  if (count[2] == 0) {
    int d;
    if (count[0] > count[1])
      d = 0;
    else
      d = 1;
    if (three[1 - d] == 0) {
      cout << "Yes" << endl;
      return 0;
    }
    cout << "No" << endl;
    return 0;
  }
  if (!(count[0] == count[1] and count[1] == count[2])) {
    cout << "No" << endl;
    return 0;
  }
  int m = max({three[0], three[1], three[2]});
  int keta = 1;
  while (m) {
    m /= 2;
    keta++;
  }
  for (int i = 0; i < keta; i++) {
    int a0 = three[0] % 2, a1 = three[1] % 2, a2 = three[2] % 2;
    three[0] /= 2;
    three[1] /= 2;
    three[2] /= 2;
    if ((a0 + a1 + a2) % 2 == 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}
