#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 10;
int a[N];
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  map<int, int> m;
  for (int i = 1; i <= n; i++) cin >> a[i], m[a[i]]++;
  if (n % 3)
    cout << "No" << endl;
  else {
    if (m.size() > 3)
      cout << "No" << endl;
    else {
      if (m.size() == 1)
        cout << "Yes" << endl;
      else if (m.size() == 3) {
        int x;
        for (auto t : m) x = t.second;
        for (auto t : m) {
          if (t.second != x) {
            cout << "No" << endl;
            return 0;
          }
        }
        vector<int> vec;
        for (auto t : m) vec.push_back(t.first);
        if (vec[0] ^ vec[1] == vec[2])
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      } else if (m.size() == 2) {
        vector<int> vec, vec2;
        for (auto t : m) vec.push_back(t.first), vec2.push_back(t.second);
        if (vec[0] != 0 && vec[1] != 0)
          cout << "No" << endl;
        else {
          if (vec[0] == 0) {
            if (vec2[0] * 2 == vec2[1])
              cout << "Yes" << endl;
            else
              cout << "No" << endl;
          } else {
            if (vec2[1] * 2 == vec2[0])
              cout << "Yes" << endl;
            else
              cout << "No" << endl;
          }
        }
      } else {
        cout << "No" << endl;
      }
    }
  }
}
