#include <bits/stdc++.h>
using namespace std;
string s;
const int max_n = 1e5 + 10;
int main() {
  int n, a[max_n];
  pair<int, int> b[3];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  bool flag = true;
  for (int i = 0; i < n; ++i) {
    if (a[i] != 0) {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "Yes" << endl;
    return 0;
  }
  flag = true;
  if (n % 3 == 0) {
    int k = 0;
    b[0].first = a[0];
    b[0].second = 0;
    for (int i = 1; i < n; ++i) {
      bool flag_2 = true;
      for (int j = 0; j <= k; ++j) {
        if (b[j].first == a[i]) {
          flag_2 = false;
          break;
        }
      }
      if (flag_2) {
        ++k;
        b[k].first = a[i];
        b[k].second = 0;
      }
    }
    if (k + 1 > 4) {
      flag = false;
    } else {
      if (k == 0) {
        flag = false;
      } else if (k == 1) {
        sort(b, b + 1);
        if (b[1].first == 0) {
          for (int i = 0; i < n; ++i) {
            for (int j = 0; j < 3; ++j) {
              if (b[j].first == a[i]) {
                ++b[j].second;
              }
            }
          }
          flag = (flag && b[1].second * 2 == b[0].second);
        } else {
          flag = false;
        }
      } else {
        if ((b[0].first ^ b[1].first) != b[2].first) {
          flag = false;
        }
        for (int i = 0; i < n; ++i) {
          for (int j = 0; j < 3; ++j) {
            if (b[j].first == a[i]) {
              ++b[j].second;
            }
          }
        }
        flag =
            (flag && b[0].second == b[1].second && b[1].second == b[2].second);
      }
    }
  } else {
    flag = false;
  }
  if (flag) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}
