#include <bits/stdc++.h>
using namespace std;
const int INT_INF = 2147483646;
const long long LL_INF = 9223372036854775807;
bool SecondCompare(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second < b.second;
}
bool SecondCompareDes(const pair<int, int> &a, const pair<int, int> &b) {
  return a.second > b.second;
}
long long minll(long long a, long long b) {
  if (a >= b)
    return b;
  else
    return a;
}
long long maxll(long long a, long long b) {
  if (a >= b)
    return a;
  else
    return b;
}
const int SIZE = 1e5 + 100;
long long n;
long long a[SIZE], cou2[3];
int main() {
  cin >> n;
  long long cou[3];
  bool f;
  for (int i = 0; i < 3; i++) cou[i] = -1;
  for (int i = 0; i < n; i++) {
    f = false;
    cin >> a[i];
    for (int j = 0; j < 3; j++) {
      if (cou[j] == -1) {
        cou[j] = a[i];
        cou2[j]++;
        f = true;
        break;
      } else {
        if (cou[j] == a[i]) {
          cou2[j]++;
          f = true;
          break;
        }
      }
    }
    if (!f) {
      cout << "No\n";
      return 0;
    }
  }
  if (cou[1] == -1 && cou[2] == -1) {
    cout << "No\n";
    return 0;
  }
  for (int i = 0; i < 3; i++) {
    if (cou[i] == -1) {
      if (cou[0] == 0) {
        if (cou2[1] - cou2[0] == 1) {
          cout << "Yes\n";
          return 0;
        } else {
          cout << "No\n";
          return 0;
        }
      } else if (cou[1] == 0) {
        if (cou2[0] - cou2[1] == 1) {
          cout << "Yes\n";
          return 0;
        } else {
          cout << "No\n";
          return 0;
        }
      } else {
        cout << "No\n";
        return 0;
      }
    }
  }
  if (cou2[0] == cou2[1] && cou2[1] == cou2[2]) {
    if (cou[0] ^ cou[1] == cou[2] && cou[2] ^ cou[0] == cou[1]) {
      cout << "Yes\n";
      return 0;
    } else {
      cout << "Yes\n";
    }
  } else {
    cout << "No\n";
    return 0;
  }
}
