#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> vec(N, 0);
  for (int i = 0; i < N; i++) {
    cin >> vec[i];
  }
  long long a = -1;
  long long b = -1;
  long long c = -1;
  a = vec[0];
  int res = 0;
  for (int j = 1; j < N; j++) {
    if (b == -1 && vec[j] != a) {
      b = vec[j];
    } else if (c == -1 && vec[j] != a && vec[j] != b) {
      c = vec[j];
    } else if (c != -1 && vec[j] != a && vec[j] != b && vec[j] != c) {
      res++;
      break;
    }
  }
  long long count1 = 0;
  long long count2 = 0;
  for (int k = 0; k < N; k++) {
    if (vec[k] > 0) {
      count2++;
    } else {
      count1++;
    }
  }
  if (a == 0 || b == 0) {
    if (c == -1 && count1 * 2 == count2) {
    } else {
      res++;
    }
  } else {
    if ((a ^ b) == c) {
    } else {
      res++;
    }
  }
  if (count2 == 0) {
    res = 0;
  }
  string ans;
  if (res == 0) {
    ans = "Yes";
  } else {
    ans = "No";
  }
  cout << ans << endl;
}
