#include <bits/stdc++.h>
using namespace std;
int n;
int a[100007];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  if (n == 3) {
    if (a[1] ^ a[2] ^ a[3] == 0)
      printf("Yes\n");
    else
      printf("No\n");
  } else {
    bool flag = true;
    for (int i = 2; i <= n; i++)
      if (a[i] != a[1]) flag = false;
    if (flag)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
