#include<stdio.h>
#include<cstdio>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>

#include<stack>
#include<queue>
#include<time.h>
#include<set>
#include<map>
#include <iomanip>
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i>b;i--)
#define vint vector<int> 
#define vvint vector<vint>
#define ct(a) cout<<a<<endl
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll mod = 1e9 + 7;



string S;

ll N,k,ans=1;
ll a[200005];
ll beki[500];
bool flag=true;

vector<int, int> v[100001];
ll p[100001];
map<int, int> mp;



int main() {
	FOR(i, 0, 100000)p[i] = -1;
	
	cin >> N;
	FOR(i, 0, N) {
		cin >> a[i];
		if (mp[a[i]] == 0)mp[a[i]]++;
	}
		sort(a, a + N);
	reverse(a, a + N);


	if (a[0] == 0)flag = true;
	else {
		if (N % 3 != 0)flag = false;
		else {
			
			ll cnt = 0;
			while (a[0] > 0) {
				if (a[0] % 2 == 0) {
					beki[cnt]++;
					p[cnt] = 0;
				}
					cnt++;
				a[0] /= 2;
			}

			FOR(j, 1, N) {
				ll cur = a[j];
				FOR(i, 0, cnt) {
					if (cur % 2 == 0)
					{
						beki[i]++;
						if (p[i] == -1)p[i] = i;
						else {
							
						}
					}
					cur /= 2;
				}
			}

			FOR(i,0,cnt)if(beki[i] != N / 3)flag = false;
		}
	}
	if (mp.size() % 3 != 0)flag = false;
	if (flag)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}