#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int tmp1;
  cin >> tmp1;
  int tmp2;
  cin >> tmp2;
  map<int, int> m;
  m[tmp1] = m[tmp1]++;
  m[tmp2] = m[tmp2]++;
  if (tmp1 == tmp2) {
    bool ans = true;
    for (int i = 0; i < n - 2; i++) {
      int tmp;
      cin >> tmp;
      if (!(tmp == 0 || tmp == tmp1)) {
        ans = false;
      }
      m[tmp] = m[tmp]++;
    }
    if (m[tmp1] - 1 == m[0] && ans) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    for (int i = 0; i < n - 2; i++) {
      int tmp;
      cin >> tmp;
      m[tmp] = m[tmp]++;
    }
    if (m[tmp1] == m[tmp2] && m[tmp1] == m[tmp1 xor tmp2] && n % 3 == 0 &&
        n / 3 == m[tmp1]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}
