#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
#pragma warning(disable : 4996)
int main() {
  int n;
  cin >> n;
  if (n == 3) {
    int a, b, c;
    cin >> a >> b >> c;
    if (a ^ b == c)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else if (!(n % 3)) {
    int a[3] = {-1, -1, -1}, c[3];
    cin >> a[0];
    c[0] = 1;
    int ch;
    int f = 1;
    for (int i = 1; i < n; i++) {
      scanf("%d", &ch);
      int j = 0;
      for (j = 0; j < 3 && a[j] != -1 && a[j] != ch; j++)
        ;
      if (j < 3 && a[j] == -1) {
        a[j] = ch;
        c[j] = 1;
        if (j == 1 && a[2] == -1) {
          a[2] = a[0] ^ a[1];
          c[2] = 0;
        }
      } else if (j < 3)
        c[j]++;
      else {
        f = 0;
        break;
      }
    }
    if (f && c[0] == c[1] && c[1] == c[2])
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  } else {
    cout << "No" << endl;
  }
}
