#include <bits/stdc++.h>
long long int mod = 1000000007;
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  int arr[n];
  std::map<int, int> map;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    map[arr[i]]++;
  }
  int temp[3];
  int k = 0;
  if (n % 3 == 0) {
    if (map.size() == 3) {
      int d = n / 3;
      for (auto i = map.begin(); i != map.end(); ++i) {
        temp[k] = i->first;
        k++;
        if (i->second != d) {
          cout << "No\n";
          return 0;
        }
      }
    } else if (map.size() == 2) {
      int d = n / 3;
      if (map[0] != d) {
        cout << "No\n";
        return 0;
      } else {
        cout << "Yes\n";
        return 0;
      }
    } else if (map.size() == 1) {
      if (map[0] == n) {
        cout << "Yes\n";
        return 0;
      } else {
        cout << "No\n";
        return 0;
      }
    } else {
      cout << "No\n";
      return 0;
    }
  } else {
    cout << "No\n";
    return 0;
  }
  sort(temp, temp + 3);
  if (temp[0] ^ temp[2] == temp[1])
    cout << "Yes\n";
  else
    cout << "No\n";
  return 0;
}
