#include <bits/stdc++.h>
using namespace std;
struct fast_ios {
  fast_ios() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  };
} fast_ios_;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {
  std::fill((T *)array, (T *)(array + N), val);
}
void pyn(bool ans) { cout << (ans ? "Yes" : "No") << endl; }
bool is_prime(long long n) {
  if (n == 1) return false;
  for (long long i = 2; i * i <= n; i++) {
    if (n % i == 0) return false;
  }
  return true;
}
vector<long long> divisor(long long n) {
  vector<long long> res;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      res.push_back(i);
      if (i != n / i) res.push_back(n / i);
    }
  }
  return res;
}
map<long long, int> prime_factor(long long n) {
  map<long long, int> res;
  for (long long i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}
vector<long long> prime_enum(int n) {
  vector<bool> is_prime(n + 1, true);
  is_prime[0] = is_prime[1] = false;
  vector<long long> res;
  for (int i = 2; i <= n; i++) {
    if (!is_prime[i]) continue;
    res.push_back(i);
    for (int j = 2 * i; j <= n; j += i) {
      is_prime[j] = false;
    }
  }
  return res;
}
long long fact[1000001];
long long mpow(long long x, long long y) {
  if (y == 0) return 1;
  if (y % 2 == 0) {
    return mpow(x * x % (long long)(1e9 + 7), y / 2) % (long long)(1e9 + 7);
  } else {
    return x * mpow(x, y - 1) % (long long)(1e9 + 7);
  }
}
long long minv(long long x) { return mpow(x, (long long)(1e9 + 7) - 2); }
long long ms(long long a, long long b) {
  return (a + b) % (long long)(1e9 + 7);
}
long long mm(long long a, long long b) {
  return (a * b) % (long long)(1e9 + 7);
}
void mfact() {
  fact[0] = 1;
  for (long long i = long long(1); i < long long(1000001); ++i) {
    fact[i] = fact[i - 1] * i % (long long)(1e9 + 7);
  }
}
long long mcombi(long long n, long long k) {
  return (fact[n] * minv(fact[k]) % (long long)(1e9 + 7)) * minv(fact[n - k]) %
         (long long)(1e9 + 7);
}
long long llceil(long long a, long long b) {
  if (a >= 0) {
    return (a + b - 1) / b;
  } else {
    return a / b;
  }
}
long long llfloor(long long a, long long b) {
  if (a < 0) {
    return (a - b + 1) / b;
  } else {
    return a / b;
  }
}
struct UnionFind {
  vector<long long> data;
  UnionFind(int size) : data(size, -1) {}
  bool unite(int x, int y) {
    x = root(x);
    y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y];
      data[y] = x;
    }
    return x != y;
  }
  bool find(int x, int y) { return root(x) == root(y); }
  int root(int x) { return data[x] < 0 ? x : data[x] = root(data[x]); }
  long long size(int x) { return -data[root(x)]; }
  long long num_root(long long size) {
    vector<long long> roots;
    for (long long i = long long(0); i < long long(size); ++i)
      roots.push_back(root(i));
    sort((roots).begin(), (roots).end());
    roots.erase(unique((roots).begin(), (roots).end()), roots.end());
    return roots.size();
  }
};
struct graph {
  int V;
  vector<vector<pair<long long, long long> > > v;
  graph(int V) : V(V), v(vector<vector<pair<long long, long long> > >(V)) {}
  void add_diedge(int v1, int v2, long long w) {
    v[v1].push_back({v2, w});
    v[v2].push_back({v1, w});
  }
  void add_edge(int v1, int v2, long long w) { v[v1].push_back({v2, w}); }
  vector<long long> dist = vector<long long>(V, -1);
  vector<int> prever = vector<int>(V, -1);
  vector<long long> dijkstra(int start) {
    priority_queue<pair<long long, long long>,
                   vector<pair<long long, long long> >,
                   greater<pair<long long, long long> > >
        que;
    que.push(pair<long long, long long>(0, start));
    while (!que.empty()) {
      pair<long long, long long> pa = que.top();
      que.pop();
      int u = pa.second;
      if (dist[u] >= 0 && dist[u] < pa.first) continue;
      dist[u] = pa.first;
      for (pair<long long, long long> e : v[u]) {
        if (dist[e.first] < 0 || dist[e.first] > dist[u] + e.second) {
          dist[e.first] = dist[u] + e.second;
          prever[e.first] = u;
          que.push(pair<long long, long long>(dist[e.first], e.first));
        }
      }
    }
    return dist;
  }
  void dfs(long long now, long long prv, long long c) {
    dist[now] = c;
    for (auto nxt : v[now])
      if (nxt.first != prv) {
        if (nxt.second % 2)
          dfs(nxt.first, now, !c);
        else
          dfs(nxt.first, now, c);
      }
  }
  void gprint() {
    for (long long i = long long(0); i < long long(V); ++i) {
      cout << (i);
      cout << (": ");
      for (pair<long long, long long> x : v[i]) {
        cout << (x.first);
        cout << (",");
        cout << (x.second);
        cout << (" ");
      }
      cout << ("") << endl;
    }
  }
};
struct SegmentTree {
 private:
  int n;
  vector<long long> node;

 public:
  SegmentTree(vector<long long> v) {
    int sz = v.size();
    n = 1;
    while (n < sz) n *= 2;
    node.resize(2 * n - 1, (long long)2147483647);
    for (int i = 0; i < sz; i++) node[i + n - 1] = v[i];
    for (int i = n - 2; i >= 0; i--)
      node[i] = min(node[2 * i + 1], node[2 * i + 2]);
  }
  void update(int x, int val) {
    x += (n - 1);
    node[x] = val;
    while (x > 0) {
      x = (x - 1) / 2;
      node[x] = min(node[2 * x + 1], node[2 * x + 2]);
    }
  }
  int get(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    cerr << "l"
         << "=" << l << endl;
    cerr << "r"
         << "=" << r << endl;
    cerr << "a"
         << "=" << a << endl;
    cerr << "b"
         << "=" << b << endl;
    if (r <= a || b <= l) return (long long)2147483647;
    if (a <= l && r <= b) return node[k];
    int vl = get(a, b, 2 * k + 1, l, (l + r) / 2);
    int vr = get(a, b, 2 * k + 2, (l + r) / 2, r);
    return min(vl, vr);
  }
};
long long a[100001], b[100001], c[100001], d, n, m, x, y, z, h, w, k,
    mi = (long long)2147483647, ma = -(long long)2147483647, ans, sum, cnt, s,
    t, l, r, res, tmp, itr, p, q;
bool flag;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dx8[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[8] = {0, 1, 1, 1, 0, -1, -1, -1};
char cha;
string st;
pair<long long, long long> pa;
bool fl;
int main(void) {
  cin >> n;
  map<long long, long long> M;
  for (long long i = long long(0); i < long long(n); ++i) {
    cin >> tmp;
    M[tmp]++;
  }
  if ((M).size() == 1) {
    if (M[0] == n)
      pyn(0);
    else
      pyn(1);
  } else if ((M).size() >= 4 || n % 3 != 0)
    pyn(0);
  else if ((M).size() == 3) {
    tmp = 0;
    fl = 1;
    for (auto itr = M.begin(); itr != M.end(); ++itr) {
      tmp ^= itr->first;
      if (n % 3 == 0 && itr->second == n / 3)
        continue;
      else
        fl = 0;
    }
    if (tmp == 0 && fl)
      pyn(1);
    else
      pyn(0);
  } else if ((M).size() == 2) {
    fl = 1;
    for (auto itr = M.begin(); itr != M.end(); ++itr) {
      if (itr->first == 0 && itr->second == n / 3)
        continue;
      else if (itr->second == 2 * n / 3)
        continue;
      else
        fl = 0;
    }
    if (fl)
      pyn(1);
    else
      pyn(0);
  }
  return 0;
}
