#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];
bool used[105]; bool flag = false ;
int n , total ;
void Try(int i , int sum){
if(flag) return ;
for(int j = i ; j <= n ; j++){
sum += a[j];
if(sum == total) flag = true ;
else if(sum < total) Try(i + 1 , sum);
sum -= a[j];
}
}
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 ;
Try(1 , 0);
if(flag) cout << "1" << endl;
else cout << "0" << endl;
}
}
int main() {
faster();
int test = 1 ;
// cin >> test ;
while(test--) solve();
return 0;
}
CgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbmRsICJcbiIKI2RlZmluZSBsbCBsb25nIGxvbmcKI2RlZmluZSBmYXN0ZXIoKSBpb3M6OnN5bmNfd2l0aF9zdGRpbyhmYWxzZSk7IGNpbi50aWUobnVsbHB0cik7IGNvdXQudGllKG51bGxwdHIpOwpjb25zdCBpbnQgTU9EID0gMWU5ICsgNyA7CgppbnQgYVsxMDVdOwpib29sIHVzZWRbMTA1XTsgYm9vbCBmbGFnID0gZmFsc2UgOwppbnQgbiAsIHRvdGFsICA7IAp2b2lkIFRyeShpbnQgaSAsIGludCBzdW0pewogICAgaWYoZmxhZykgcmV0dXJuIDsKCiAgICBmb3IoaW50IGogPSBpIDsgaiA8PSBuIDsgaisrKXsKICAgICAgICBzdW0gKz0gYVtqXTsKICAgICAgICBpZihzdW0gPT0gdG90YWwpIGZsYWcgPSB0cnVlIDsKICAgICAgICBlbHNlIGlmKHN1bSA8IHRvdGFsKSBUcnkoaSArIDEgLCBzdW0pOwogICAgICAgIHN1bSAtPSBhW2pdOwogICAgfQp9Cgp2b2lkIHNvbHZlKCl7CiAgIC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