#include <bits/stdc++.h>
using std::map;
const int N = 1e5 + 5;
int n;
int a[N];
map<int, int> M;
signed main() {
  int a, b, c;
  register int i;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d", &::a[i]), M[::a[i]]++;
  if ((int)M.size() > 3) return puts("No"), 0;
  if (n % 3 == 0) {
    switch ((int)M.size()) {
      case 1:
        puts("Yes");
        break;
      case 2:
        a = M.begin()->second;
        b = (++M.begin())->second;
        if (((++M.begin())->first == 0 && a == b * 2) ||
            (M.begin()->first == 0 && b == a * 2))
          puts("Yes");
        else
          puts("No");
        break;
      case 3:
        a = M.begin()->second;
        b = (++M.begin())->second;
        c = (++(++M.begin()))->second;
        if (M.begin()->first ^ (++M.begin())->first ^
                (++(++M.begin()))->first == 0 &&
            a == b && a == c)
          puts("Yes");
        else
          puts("No");
    }
  } else {
    if ((int)M.size() > 1)
      puts("No");
    else if (::a[1] == 0)
      puts("Yes");
    else
      puts("No");
  }
  return 0;
}
