#include <bits/stdc++.h>
#pragma GCC optimize("03")
using namespace std;
int n, a[100100];
set<int> s;
map<int, int> mp;
int tr(int x, int y, int z) {
  map<int, int> m;
  int v[100100];
  v[1] = x;
  v[2] = y;
  v[3] = z;
  m[x]++;
  m[y]++;
  m[z]++;
  for (int i = 4; i <= n; i += 3) {
    v[i] = x;
    v[i + 1] = y;
    v[i + 2] = z;
    if (i <= n) m[x]++;
    if (i + 1 <= n) m[y]++;
    if (i + 2 <= n) m[z]++;
  }
  bool ch = 1;
  a[0] = a[n];
  a[n + 1] = a[1];
  for (int i = 1; i <= n; i++)
    if (a[i] != (a[i - 1] ^ a[i + 1])) ch = 0;
  if (m[x] != mp[x] || m[y] != mp[y] || m[z] != mp[z]) ch = 0;
  return ch;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    mp[a[i]]++;
    s.insert(a[i]);
  }
  if ((int)s.size() > 3) return cout << "No", 0;
  int f = 0;
  for (auto it1 : s)
    for (auto it2 : s)
      for (auto it3 : s) f |= tr(it1, it2, it3);
  if (f)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}
