#include <bits/stdc++.h>
int n, a[100005];
int b[100005], c[100005];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  int m = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m + 1; j++) {
      if (j == (m + 1)) {
        m++;
        b[m] = a[i];
        break;
      }
      if (b[j] == a[i]) {
        c[j]++;
        break;
      }
    }
    if (m > 3) break;
  }
  int k = 0;
  if (m == 1 & b[1] == 0)
    k = 1;
  else if (m == 3 && c[1] == c[2] && c[1] == c[3] && (b[1] | b[2]) == b[3])
    k = 1;
  if (k)
    printf("Yes");
  else
    printf("No");
}
