#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  string ans = "Yes";
  if (n % 3 != 0) {
    for (int i = 1; i < (int)(n); i++) {
      if (a[i] != a[0]) {
        ans = "No";
        break;
      }
    }
  } else {
    unordered_map<long long, int> count;
    for (int i = 0; i < (int)(n); i++) {
      if (count.count(a[i]) == 0) {
        count[a[i]] = 1;
      } else {
        count[a[i]]++;
      }
    }
    vector<long long> keys;
    for (auto itr = count.begin(); itr != count.end(); ++itr) {
      int val = itr->second;
      long long key = itr->first;
      keys.push_back(key);
      if (val != n / 3) {
        ans = "No";
      }
    }
    if (ans == "Yes") {
      if ((keys[0] ^ keys[1] ^ keys[2]) != 0) {
        cout << "W";
        ans = "No";
      }
    }
  }
  cout << ans;
}
