// Slower C++ solution:
//#pragma GCC optimize("Ofast")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,avx,avx2")

#include <bits/stdc++.h>



using namespace std;



#define PB push_back

#define MP make_pair

#define EB emplace_back

#define f first

#define s second

#define FOR(i,a,b) for (int i = a; i < (b); ++i)

#define RFOR(i, b, a) for (int i = b-1; i>=a; --i)

#define FILL(a, b) memset(a, b, sizeof a)

#define ALL(a) a.begin(), a.end()

#define SZ(a) ((int)a.size())

#define bitc(n) __builtin_popcount(n)

#define MAGIC0 mt19937 rnd(time(0)); //rnd()



typedef long long LL;

typedef unsigned long long ULL;

typedef vector<int> VI;

typedef pair<int, int> PII;

typedef pair<LL, LL> PLL;



const int INF = 1000 * 1000 * 1000 + 7;

const LL LINF = 1LL * INF*INF;

const int MAX = 1e6 + 7;

const double PI = acos(-1.);

const double EPS = 1e-7;

const int MAXN = 100005;



mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());



set<int> x[100005];

int cnt[100005];



int main()

{

	ios_base::sync_with_stdio(0);

	//freopen("input.txt", "r", stdin);

	//freopen("output.txt", "w", stdout);

	int n;

	cin >> n;

	VI a(n);

	FOR(i, 0, n)

	{

		cin >> a[i];

	}

	sort(ALL(a));

	

	if (n % 3 != 0)

	{

		if (a[0] == a[n - 1])

		{

			cout << "Yes\n";

		}

		else

		{

			cout << "No\n";

		}

	}

	else

	if (a[0] == a[n / 3 - 1] && a[n / 3] == a[2 * n / 3 - 1] && a[2 * n / 3] == a[n - 1] && ((a[0] ^ a[n / 3] ^ a[2*n/3]) == 0))

	{

		cout << "Yes\n";

	}

	else

	{

		cout << "No\n";

	}

	

	return 0;

}
















// Faster C++ solution for the same problem (measured speedup: 6.424514737674486x):
/*

 * Author : Andrew J

*/

#include <bits/stdc++.h>

using namespace std;

#define rall(x) x.rbegin() , x.rend()

#define all(x) x.begin() , x.end()

#define fi first

#define se second

#define pb push_back

using ll = long long;

using ii = pair <int , int>;

void in(int &x);

const int N = 1e5 + 10;

#define singleCase

// #define multipleCase

int n,a[N];

map <int , int> freq;



void work() {

   in(n);

   for (int i = 1 ; i <= n ; i++) {

      in(a[i]);

      freq[a[i]]++;

   }

   if (freq.size() > 3) {

      puts("No");

      return;

   } else if (freq.size() == 3) {

      int res = 0, lowest = INT_MAX;

      for (ii x : freq) {

         res ^= x.fi;

         lowest = min(lowest , x.se);

      }

      if (res != 0) {

         puts("No");

         return;

      }

      for (ii x : freq) {

         if (x.se - lowest > 0) {

            puts("No");

            return;

         }

      }

   } else if (freq.size() == 2) {

      vector <int> v;

      for (ii x : freq) {

         v.pb(x.fi);

      }

      if (v[0] == 0) {

         if (freq[0] * 2 != freq[v[1]]) {

            puts("No");

            return;

         }

      } else if (v[1] == 0) {

         if (freq[0] * 2 != freq[v[0]]) {

            puts("No");

            return;

         }

      } else {

         puts("No");

         return;

      }

   } else {

      for (ii x : freq) {

         if (x.fi != 0) {

            puts("No");

            return;

         }

      }

   }

   puts("Yes");

   return;

}



int main() {

   #ifdef multipleCase

      int nQ; in(nQ);

      while (nQ--)

         work();

   #endif

   #ifdef singleCase

      work();

   #endif

   return 0;

}



void in(int &x) {

	bool neg = false;

	register int c;

	x = 0;

	c = getchar();

	if(c == '-') {

		neg = true;

		c = getchar();

	}

	for (; c > 47 && c < 58; c = getchar())

	  x = (x << 1) + (x << 3) + c - 48;

	if (neg) x *= -1;

}