#include <bits/stdc++.h>
using namespace std;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a.at(i);
  sort(a.begin(), a.end());
  for (long long i = 1; i < n; i++) {
    vector<long long> ans(n);
    ans.at(0) = a.at(0);
    ans.at(1) = a.at(i);
    vector<long long> twosinsu(30);
    vector<long long> twosinsu2(30);
    long long x = a.at(0);
    long long y = 29;
    while (x > 0) {
      twosinsu.at(y) = x % 2;
      x /= 2;
      y--;
    }
    x = a.at(i);
    y = 29;
    while (x > 0) {
      twosinsu2.at(y) = x % 2;
      x /= 2;
      y--;
    }
    for (long long j = 2; j < n; j++) {
      vector<long long> twosinsu3(30);
      for (long long i = 0; i < 29; i++) {
        twosinsu3.at(i) = twosinsu.at(i) ^ twosinsu2.at(i);
      }
      long long news = 0;
      for (long long i = 0; i < 29; i++) {
        news += twosinsu3.at(29 - i) * pow(2, i);
      }
      auto itr = lower_bound(a.begin(), a.end(), news);
      if (news != *itr) {
        break;
      }
      ans.at(j) = news;
      for (long long i = 0; i < 30; i++) {
        twosinsu.at(i) = twosinsu2.at(i);
        twosinsu2.at(i) = twosinsu3.at(i);
      }
    }
    bool hantei1 = false, hantei2 = false;
    if ((ans.at(0) ^ ans.at(n - 2)) == ans.at(n - 1)) {
      hantei1 = true;
    }
    sort(ans.begin(), ans.end());
    for (long long i = 0; i < n; i++) {
      if (a.at(i) != ans.at(i)) break;
      if (i == n - 1) hantei2 = true;
    }
    if (hantei1 && hantei2) {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}
