#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long mod = 1000000007;
auto TimeStart = chrono::steady_clock::now();
const int nax = 1e5 + 10;
vector<int> A;
bool make(int a, int b) {
  if (a == b) return true;
  if ((a + 1) == b) return true;
  return false;
}
void solve() {
  int n;
  cin >> n;
  A.resize(n);
  map<int, int> M;
  for (int i = 0; i < n; ++i) {
    cin >> A[i];
    M[A[i]]++;
  }
  if (n == 3) {
    if (M.size() == 2) {
      int a = M.begin()->first;
      int b = (++M.begin())->first;
      int ac = M.begin()->second;
      int bc = (++M.begin())->second;
      if (a == 0) {
        if (ac == 1) {
          ;
          cout << "Yes";
          return;
        }
      }
    }
  }
  if (M.size() == 1) {
    int a = M.begin()->first;
    cout << "No";
    return;
  }
  if (M.size() == 2) {
    int a = M.begin()->first;
    int b = (++M.begin())->first;
    int ac = M.begin()->second;
    int bc = (++M.begin())->second;
    if (a == 0) {
      if (b == 1)
        if (make(ac, bc) || make(bc, ac)) {
          cout << "Yes";
        } else
          cout << "No";
      else
        cout << "No";
    } else
      cout << "No";
    return;
  }
  if (M.size() == 3) {
    ;
    int a = M.begin()->first;
    int b = (++M.begin())->first;
    int c = (++(++M.begin()))->first;
    int ac = M.begin()->second;
    int bc = (++M.begin())->second;
    int cc = (++(++M.begin()))->second;
    int x = n / 3, y = n / 3, z = n / 3;
    if (n % 3 == 1) {
      ++x;
    }
    if (n % 3 == 2) {
      ++x;
      ++y;
    };
    if ((a ^ c) == b) {
      if (ac == x && bc == y && cc == z) {
        cout << "Yes";
        return;
      }
      if (ac == z && bc == y && cc == x) {
        cout << "Yes";
        return;
      }
    }
    if ((a ^ b) == c) {
      if (ac == x && bc == z && cc == y) {
        cout << "Yes";
        return;
      }
      if (ac == z && bc == x && cc == y) {
        cout << "Yes";
        return;
      }
    }
    if ((c ^ b) == a) {
      if (ac == y && bc == x && cc == z) {
        cout << "Yes";
        return;
      }
      if (ac == y && bc == y && cc == z) {
        cout << "Yes";
        return;
      }
    }
    cout << "No";
  } else {
    cout << "No";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}
