#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define ll long long
#define faster() ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
const int MOD = 1e9 + 7 ;
int a[105], dp[105] , n , total;
void solve(){
total = 0 ;
cin >> n ;
for(int i = 1 ; i <= n ; i++){
cin >> a[i];
total += a[i];
}
if(total % 2 != 0) cout << "0" << endl ;
else{
total /= 2 ;
dp[0] = 1 ;
for(int i = 1 ; i <= total ; i++){
for(int j = 1 ; j <= n ; j++){
if(i - a[j] >= 0 && dp[i - a[j]]){
dp[i] = 1;
}
}
}
cout << dp[total] ;
}
}
int main() {
faster();
int test = 1 ;
// cin >> test ;
while(test--) solve();
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgZW5kbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgZmFzdGVyKCkgaW9zOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpOyBjaW4udGllKG51bGxwdHIpOyBjb3V0LnRpZShudWxscHRyKTsKY29uc3QgaW50IE1PRCA9IDFlOSArIDcgOwoKaW50IGFbMTA1XSwgZHBbMTA1XSAsIG4gLCB0b3RhbDsKCnZvaWQgc29sdmUoKXsKICAgIHRvdGFsID0gMCA7CiAgICBjaW4gPj4gbiAgOwogICAgZm9yKGludCBpID0gMSA7IGkgPD0gbiA7IGkrKyl7CiAgICAgICAgY2luID4+IGFbaV07CiAgICAgICAgdG90YWwgKz0gYVtpXTsKICAgIH0KICAgIGlmKHRvdGFsICUgMiAhPSAwKSBjb3V0IDw8ICIwIiA8PCBlbmRsIDsKICAgIGVsc2V7CiAgICAgICAgdG90YWwgLz0gMiA7CiAgICAgICAgZHBbMF0gPSAxIDsKICAgICAgICBmb3IoaW50IGkgPSAxIDsgaSA8PSB0b3RhbCA7IGkrKyl7CiAgICAgICAgICAgIGZvcihpbnQgaiA9IDEgOyBqIDw9IG4gOyBqKyspewogICAgICAgICAgICAgICAgaWYoaSAtIGFbal0gPj0gMCAmJiBkcFtpIC0gYVtqXV0pewogICAgICAgICAgICAgICAgICAgIGRwW2ldID0gMTsKICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBjb3V0IDw8IGRwW3RvdGFsXSA7CiAgICB9Cn0gICAKCgppbnQgbWFpbigpIHsKICAgIGZhc3RlcigpOyAKICAgIGludCB0ZXN0ID0gMSA7IAogICAgLy8gY2luID4+IHRlc3QgOwogICAgd2hpbGUodGVzdC0tKSAgIHNvbHZlKCk7CiAgICByZXR1cm4gMDsKfQoKCg==