#include <bits/stdc++.h>
using namespace std;
string s;
bool reach(int start, int goal) {
  int pos = start;
  while (pos < goal) {
    if (pos + 2 == goal || pos + 1 == goal) return true;
    if (s[pos + 2] == '.')
      pos += 2;
    else if (s[pos + 1] == '.')
      pos++;
    else
      return false;
  }
}
int main(void) {
  int n;
  cin >> n;
  long long int num[3][2];
  for (int i = 0; i < 3; i++) {
    num[i][0] = -1;
    num[i][1] = 0;
  }
  int cnt = 0;
  bool flag = true;
  for (int i = 0; i < n; i++) {
    long long int a;
    cin >> a;
    if (num[0][0] == -1) {
      num[0][0] = a;
      num[0][1]++;
      cnt++;
      continue;
    } else if (num[0][0] == a) {
      num[0][1]++;
      continue;
    }
    if (num[1][0] == -1) {
      num[1][0] = a;
      num[1][1]++;
      cnt++;
      continue;
    } else if (num[1][0] == a) {
      num[1][1]++;
      continue;
    }
    if (num[2][0] == -1) {
      num[2][0] = a;
      num[2][1]++;
      cnt++;
      continue;
    } else if (num[2][0] == a) {
      num[2][1]++;
      continue;
    }
    flag = false;
    break;
  }
  if (cnt == 1 && num[0][0] == 0)
    cout << "Yes" << endl;
  else if (n % 3 != 0 || !flag || !(num[0][0] == num[1][0] ^ num[2][0]))
    cout << "No" << endl;
  else if (cnt == 1)
    cout << "Yes" << endl;
  else if (cnt == 2 && ((num[0][0] == 0 && num[0][1] == 2 * num[1][1]) ||
                        (num[1][0] == 0 && num[0][1] * 2 == num[1][1])))
    cout << "Yes" << endl;
  else if (cnt == 3 && (num[0][1] == num[1][1] && num[1][1] == num[2][1]))
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}
