#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 114514;
int a[MAX_N];
int number[3];
int value[3];
int main() {
  int N;
  cin >> N;
  fill(value, value + 3, -1);
  fill(number, number + 3, 0);
  int count = 0;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    switch (count) {
      case 0:
        value[0] = tmp;
        number[0]++;
        count++;
        break;
      case 1:
        if (value[0] == tmp) {
          number[0]++;
        } else {
          value[1] = tmp;
          number[1]++;
          count++;
        }
        break;
      case 2:
        if (value[0] == tmp) {
          number[0]++;
        } else if (value[1] == tmp) {
          number[1]++;
        } else {
          value[2] = tmp;
          number[2]++;
          count++;
        }
        break;
      case 3:
        if (tmp == value[0]) {
          number[0]++;
        } else if (tmp == value[1]) {
          number[1]++;
        } else if (tmp == value[2]) {
          number[2]++;
        } else {
          cout << "No" << endl;
          return 0;
        }
        break;
    }
  }
  if (count == 1) {
    if (value[0] == 0)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
    return 0;
  }
  if (count == 2) {
    if (value[0] == 0 || value[1] == 0) {
      if (value[0] == 0) {
        if (number[1] == number[0] * 2) {
          cout << "Yes" << endl;
          return 0;
        }
      } else {
        if (number[0] == number[1] * 2) {
          cout << "Yes" << endl;
          return 0;
        }
      }
    }
    cout << "No" << endl;
    return 0;
  }
  if (number[0] != number[1] || number[0] != number[2]) {
    cout << "No" << endl;
    return 0;
  }
  if (value[0] ^ value[1] ^ value[2] == 0) {
    cout << "Yes" << endl;
    return 0;
  } else {
    cout << "No" << endl;
    return 0;
  }
}
