#include <bits/stdc++.h>
template <class _T>
static _T tp_abs(const _T& a) {
  return ((a < 0) ? (a * -1) : a);
}
template <class _T>
static _T tp_min(_T a, _T b) {
  return a < b ? a : b;
}
template <class _T>
static _T tp_max(_T a, _T b) {
  return a > b ? a : b;
}
template <class _T>
static void get1int(_T& a) {
  const char* fmt = " %d";
  if (sizeof(_T) == sizeof(long long)) {
    fmt = " %lld";
  }
  if (scanf(fmt, &a) < 0) {
    printf("g1int Error\n");
  }
}
template <class _T>
static void get2int(_T& a, _T& b) {
  const char* fmt = " %d %d";
  if (sizeof(_T) == sizeof(long long)) {
    fmt = " %lld %lld";
  }
  if (scanf(fmt, &a, &b) < 0) {
    printf("g2int Error\n");
  }
}
template <class _T>
static void get3int(_T& a, _T& b, _T& c) {
  const char* fmt = " %d %d %d";
  if (sizeof(_T) == sizeof(long long)) {
    fmt = " %lld %lld %lld";
  }
  if (scanf(fmt, &a, &b, &c) < 0) {
    printf("g3int Error\n");
  }
}
static void getstring(char* buff) {
  if (scanf(" %s", buff) < 0) {
    printf("getstr error!\n");
  }
}
static void A_task();
int main() {
  A_task();
  fflush(stdout);
  return 0;
}
class A_Num {
 public:
  long long num = 0;
  bool picked = false;
  static bool asc_num(const A_Num& a, const A_Num& b) { return a.num < b.num; }
};
static int binSearch(const long long& xpoint, const long long* container,
                     int contCount, int& secondIdx) {
  int startPoint = 0, endPoint = contCount;
  int bsTarget = 0, tmpTarget = 0;
  long long dist = 0, tmpDist = 0;
  while (1) {
    bsTarget = (startPoint + endPoint) / 2;
    if ((endPoint - startPoint) < 2) {
      bsTarget = secondIdx = -1;
      if ((container[bsTarget] < xpoint) && ((bsTarget + 1) < contCount)) {
        secondIdx = bsTarget + 1;
      } else if ((container[bsTarget] >= xpoint) && ((bsTarget - 1) >= 0)) {
        secondIdx = bsTarget - 1;
      }
      break;
    } else if (container[bsTarget] < xpoint) {
      startPoint = bsTarget;
    } else if (container[bsTarget] > xpoint) {
      endPoint = bsTarget;
    } else {
      break;
    }
  }
  return bsTarget;
}
static void A_task() {
  int N;
  get1int(N);
  auto aNum = new long long[N + 1];
  for (int i = 0; i < N; i++) {
    get1int<long long>(aNum[i]);
  }
  std::sort(aNum, aNum + N);
  const char* ans = "Yes\n";
  for (int i = 0; i < N - 1; i++) {
    long long tmp = aNum[i] ^ aNum[i + 1];
    int dmy;
    if (binSearch(tmp, aNum, N - 1, dmy) < 0) {
      ans = "No\n";
      break;
    }
  }
  printf(ans);
  delete[] aNum;
}
