#include <bits/stdc++.h>
using namespace std;
const int maxx = 20;
int a[maxx];
unordered_map<int, int> mp;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] == 0) cnt++;
  }
  if (cnt == n) {
    return 0 * puts("Yes");
  }
  if (n % 3) {
    return 0 * puts("No");
  }
  for (int i = 1; i <= n; i++) {
    mp[a[i]]++;
  }
  if (cnt > 0) {
    if (cnt == n / 3) {
      for (auto t : mp) {
        if (t.first == 0) continue;
        if (t.second == n / 2 * 3) {
          return 0 * puts("Yes");
        } else {
          return 0 * puts("No");
        }
      }
    } else {
      return 0 * puts("No");
    }
  }
  if (mp.size() == 3) {
    for (auto t : mp) {
      if (t.second != n / 3) {
        return 0 * puts("No");
      }
    }
    int ans = 0;
    for (auto t : mp) {
      ans ^= t.first;
    }
    if (ans)
      return 0 * puts("No");
    else
      return 0 * puts("Yes");
  } else {
    return 0 * puts("No");
  }
}
