#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  long long A = -1, B = -1, C = -1;
  int a = 0, b = 0, c = 0;
  bool ans = true, ans1 = true;
  for (int i = 0; i < N; i++) {
    long long x;
    cin >> x;
    if (A == -1 || A == x) {
      A = x;
      a++;
    } else if (B == -1 || B == x) {
      B = x;
      b++;
    } else if (C == -1 || C == x) {
      C = x;
      c++;
    } else {
      ans1 = false;
      break;
    }
  }
  if (ans1) {
    if (A == 0 && B == -1 && C == -1)
      ans = true;
    else if (C == -1) {
      if (A == 0 && b == 2 * a)
        ans = true;
      else if (B == 0 && a == 2 * b)
        ans = true;
      else
        ans = false;
    } else if (a != b || a != c)
      ans = false;
    else if (A ^ B == C)
      ans = true;
    else
      ans = false;
  }
  if (ans && ans1)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}
