#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};
int main() {
  int n;
  cin >> n;
  set<int> s;
  int tem;
  int s1 = -1, s2 = -1, s3 = -1;
  int c1 = 1, c2 = 1, c3 = 1;
  for (int64_t i = (0); i < (n); i++) {
    int fo = s.size();
    cin >> tem;
    s.insert(tem);
    if (s.size() > 3) {
      cout << "No" << endl;
      return 0;
    }
    if (fo == s.size()) {
      if (tem == s1) c1++;
      if (tem == s2) c2++;
      if (tem == s3) c3++;
    } else {
      if (s.size() == 1) s1 = tem;
      if (s.size() == 2) s2 = tem;
      if (s.size() == 3) s3 = tem;
    }
  }
  if (s.size() == 3) {
    if (!(c1 == c2 && c2 == c3)) {
      cout << "No" << endl;
      return 0;
    }
    bitset<100> bs1 = s1;
    bitset<100> bs2 = s2;
    bitset<100> bs3 = s3;
    bitset<100> temp = bs1 ^ bs2 ^ bs3;
    if (temp != 0) {
      cout << "No" << endl;
      return 0;
    } else
      cout << "Yes" << endl;
  } else if (s.size() == 2) {
    if (s1 == 0 || s2 == 0) {
      if (s1 == 0 && c1 * 2 == c2) {
        cout << "Yes" << endl;
        return 0;
      }
      if (s2 == 0 && c2 * 2 == c1) {
        cout << "Yes" << endl;
        return 0;
      }
    }
    cout << "No" << endl;
    return 0;
  } else if (s.size() == 1) {
    if (s1 == 0) cout << "Yes" << endl;
    return 0;
    cout << "No" << endl;
  }
  cout << "No" << endl;
  return 0;
}
