#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
typedef long long int ll;

#define PI (acos(-1))
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define dumparr(x) cerr << #x ; for(auto elem: x){cerr << " " << elem;} cerr << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

int main(void){
    int n; cin >> n;
    vector <int> hats;
    int hat;
    REP(i, n){
        cin >> hat;
        hats.push_back(hat);
    }
    sort(hats.begin(), hats.end());
    bool result = true;
    if (n%3 == 0){

    } else {
        result = false;
    }
    if (result){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}