#include <bits/stdc++.h>
using namespace std;
inline signed wait() { return 0; }
inline void dout(const char *arg, ...) {}
template <typename T>
inline void SWAP(T &a, T &b) {
  T t = a;
  a = b;
  b = t;
}
inline void CSWAP(char *&a, char *&b) {
  char *t = a;
  a = b;
  b = t;
}
int _ret;
void read(int num, int *ar) {
  for (int i = 0; i < num; ++i) _ret = _ret = scanf("%d", &ar[i]);
}
void read(int num, long long int *ar) {
  for (int i = 0; i < num; ++i) _ret = _ret = scanf("%lld", &ar[i]);
}
void read(int num, double *ar) {
  for (int i = 0; i < num; ++i) _ret = _ret = scanf("%lf", &ar[i]);
}
void read(int num, int *ar1, int *ar2) {
  for (int i = 0; i < num; ++i) _ret = _ret = scanf("%d %d", &ar1[i], &ar2[i]);
}
void read(int num, long long int *ar1, long long int *ar2) {
  for (int i = 0; i < num; ++i)
    _ret = _ret = scanf("%lld %lld", &ar1[i], &ar2[i]);
}
void read(int num, double *ar1, double *ar2) {
  for (int i = 0; i < num; ++i)
    _ret = _ret = scanf("%lf %lf", &ar1[i], &ar2[i]);
}
void read(int num, int *ar1, int *ar2, int *ar3) {
  for (int i = 0; i < num; ++i)
    _ret = _ret = scanf("%d %d %d", &ar1[i], &ar2[i], &ar3[i]);
}
void read(int num, long long int *ar1, long long int *ar2, long long int *ar3) {
  for (int i = 0; i < num; ++i)
    _ret = _ret = scanf("%lld %lld %lld", &ar1[i], &ar2[i], &ar3[i]);
}
void read(int num, double *ar1, double *ar2, double *ar3) {
  for (int i = 0; i < num; ++i)
    _ret = _ret = scanf("%lf %lf %lf", &ar1[i], &ar2[i], &ar3[i]);
}
void read(int num, int *ar1, int *ar2, int *ar3, int *ar4) {
  for (int i = 0; i < num; ++i)
    _ret = _ret = scanf("%d %d %d %d", &ar1[i], &ar2[i], &ar3[i], &ar4[i]);
}
void read(int num, long long int *ar1, long long int *ar2, long long int *ar3,
          long long int *ar4) {
  for (int i = 0; i < num; ++i)
    _ret = _ret =
        scanf("%lld %lld %lld %lld", &ar1[i], &ar2[i], &ar3[i], &ar4[i]);
}
void read(int num, double *ar1, double *ar2, double *ar3, double *ar4) {
  for (int i = 0; i < num; ++i)
    _ret = _ret = scanf("%lf %lf %lf %lf", &ar1[i], &ar2[i], &ar3[i], &ar4[i]);
}
int ToBitArray(int n, int b, int *a) {
  int m = 1, c = 0;
  for (int i = 0; i < b; ++i) {
    c += a[i] = n & m;
    m *= 2;
  }
  return c;
}
int ToBitArray(long long int n, int b, int *a) {
  int m = 1, c = 0;
  for (int i = 0; i < b; ++i) {
    c += a[i] = n & m;
    m *= 2;
  }
  return c;
}
void CombSort(int N, int *ar, int order_ascending) {
  if (N <= 1) return;
  int h = int(N / 1.3);
  int flag;
  int i;
  while (true) {
    flag = 0;
    for (i = 0; i + h < N; ++i) {
      if ((order_ascending && ar[i] > ar[i + h]) ||
          (!order_ascending && ar[i] < ar[i + h])) {
        swap<int>(ar[i], ar[i + h]);
        flag = 1;
      }
    }
    if (h == 1 && !flag) break;
    if (h == 9 || h == 10) h = 11;
    if (h > 1) h = int(h / 1.3);
  }
}
void CombSort_ll(int N, long long int *ar, int order_ascending) {
  if (N <= 1) return;
  int h = int(N / 1.3);
  int flag;
  int i;
  while (true) {
    flag = 0;
    for (i = 0; i + h < N; ++i) {
      if ((order_ascending && ar[i] > ar[i + h]) ||
          (!order_ascending && ar[i] < ar[i + h])) {
        swap<long long int>(ar[i], ar[i + h]);
        flag = 1;
      }
    }
    if (h == 1 && !flag) break;
    if (h == 9 || h == 10) h = 11;
    if (h > 1) h = int(h / 1.3);
  }
}
int EuclideanAlgorithm(int N, int *ar) {
  for (int n = 0; n < N - 1; ++n) {
    while (true) {
      if (ar[n] == 0 || ar[n + 1] == 0) {
        if (ar[n] < ar[n + 1]) ar[n] = ar[n + 1];
        ar[n + 1] = ar[n];
        break;
      }
      if (ar[n] % ar[n + 1] == 0 || ar[n + 1] % ar[n] == 0) {
        ar[n + 1] = ar[n] < ar[n + 1] ? ar[n] : ar[n + 1];
        break;
      }
      if (ar[n] > ar[n + 1]) {
        ar[n] %= ar[n + 1];
      } else {
        ar[n + 1] %= ar[n];
      }
    }
  }
  return ar[N - 1];
}
int Euclid(int n, int *ar) { return EuclideanAlgorithm(n, ar); }
long long int EuclideanAlgorithm_lli(int N, long long int *ar) {
  for (int n = 0; n < N - 1; ++n) {
    while (true) {
      if (ar[n] == 0 || ar[n + 1] == 0) {
        if (ar[n] < ar[n + 1]) ar[n] = ar[n + 1];
        ar[n + 1] = ar[n];
        break;
      }
      if (ar[n] % ar[n + 1] == 0 || ar[n + 1] % ar[n] == 0) {
        ar[n + 1] = ar[n] < ar[n + 1] ? ar[n] : ar[n + 1];
        break;
      }
      if (ar[n] > ar[n + 1]) {
        ar[n] %= ar[n + 1];
      } else {
        ar[n + 1] %= ar[n];
      }
    }
  }
  return ar[N - 1];
}
long long int Euclid_lli(int n, long long int *ar) {
  return EuclideanAlgorithm_lli(n, ar);
}
int EuclideanAlgorithmPreserved(int N, int *ar) {
  int a, b;
  a = ar[0];
  for (int n = 0; n < N - 1; ++n) {
    b = ar[n + 1];
    while (true) {
      if (a == 0 || b == 0) {
        if (a < b) a = b;
        b = a;
        break;
      }
      if (a % b == 0 || b % a == 0) {
        b = a < b ? a : b;
        break;
      }
      if (a > b) {
        a %= b;
      } else {
        b %= a;
      }
    }
    a = b;
  }
  return a;
}
int Euclid2(int n, int *ar) { return EuclideanAlgorithmPreserved(n, ar); }
template <typename T>
void CombSort(int N, T *ar, int order_ascending) {
  if (N <= 1) return;
  int i, flag;
  int h = int(N / 1.3);
  while (true) {
    flag = 0;
    for (i = 0; i + h < N; ++i) {
      if (order_ascending && ar[i].SortValue > ar[i + h].SortValue ||
          !order_ascending && ar[i].SortValue < ar[i + h].SortValue) {
        SWAP<T>(ar[i], ar[i + h]);
        flag = 1;
      }
    }
    if (h > 1) {
      h = int(h / 1.3);
      if (h == 9 || h == 10) h = 11;
    } else {
      if (!flag) break;
    }
  }
}
struct UnionFind {
  vector<int> par;
  UnionFind(int N) : par(N) {
    for (int i = 0; i < N; i++) par[i] = i;
  }
  int root(int x) {
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }
  void unite(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    if (rx == ry) return;
    par[rx] = ry;
  }
  bool same(int x, int y) {
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};
void Replace(char *c, int len, char before, char after) {
  for (int i = 0; i < len; ++i) {
    if (c[i] == before) c[i] = after;
  }
}
void Replace(char *c, char before, char after) {
  int len = strlen(c);
  Replace(c, len, before, after);
}
char ch[200010], cbuf[128][1024];
int a[100010];
int num[3], num_count;
int cnt[3] = {0};
signed main() {
  int zero_other_flag = 0;
  num_count = 0;
  int N;
  _ret = _ret = scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    _ret = _ret = scanf("%d", &a[i]);
    if (a[i] != 0) zero_other_flag = 1;
    if (i == 0) {
      num_count = 1;
      num[0] = a[i];
      cnt[0] = 1;
      continue;
    }
    if (num_count == 1) {
      if (a[i] != num[0]) {
        num[1] = a[i];
        num_count++;
        cnt[1] = 1;
      } else {
        cnt[0]++;
      }
    } else if (num_count == 2) {
      if (a[i] != num[0] && a[i] != num[1]) {
        num[2] = a[i];
        num_count++;
        cnt[2] = 1;
      } else if (a[i] == num[0]) {
        cnt[0]++;
      } else if (a[i] == num[1]) {
        cnt[1]++;
      }
    } else if (num_count == 3) {
      if (a[i] != num[0] && a[i] != num[1] && a[i] != num[2]) {
        {
          cout << "No" << endl;
          return wait();
        };
      }
    }
  }
  if (N % 3 != 0 && zero_other_flag) {
    cout << "No" << endl;
    return wait();
  };
  if (!zero_other_flag) {
    cout << "Yes" << endl;
    return wait();
  };
  if (num_count == 2) {
    if (cnt[0] == N / 3) {
      if (cnt[1] == 2 * N / 3) {
        cout << "No" << endl;
        return wait();
      };
      if (((num[0] ^ num[1]) == num[0]) && ((num[0] ^ num[0]) == num[1])) {
        cout << "Yes" << endl;
        return wait();
      };
    }
    if (cnt[1] == N / 3) {
      if (cnt[0] == 2 * N / 3) {
        cout << "No" << endl;
        return wait();
      };
      if (((num[0] ^ num[1]) == num[1]) && ((num[1] ^ num[1]) == num[0])) {
        cout << "Yes" << endl;
        return wait();
      };
    }
  }
  if (num_count == 3) {
    if (cnt[0] != N / 3 || cnt[1] != N / 3 || cnt[2] != N / 3) {
      cout << "No" << endl;
      return wait();
    };
    if (((num[0] ^ num[2]) == num[1]) && ((num[0] ^ num[1]) == num[2]) &&
        ((num[1] ^ num[2]) == num[0])) {
      cout << "Yes" << endl;
      return wait();
    };
  }
  {
    cout << "No" << endl;
    return wait();
  };
  return wait();
}
