typedef long long ll; typedef long double ld; #include using namespace std; #define int long long signed main(){ ll n; std::cin >> n; vector e(n); ll sum = 0; for (int i = 0; i < n; i++) { std::cin >> e[i]; sum += e[i]; } if(sum%3!=0){ std::cout << "No" << std::endl; return 0; } for (int i = 0; i < (1<>j)&1)tmp += e[j]; } if(tmp!=sum/3)continue; for (int j = 0; j < (1<>k)&1)&&(j>>k)&1)tmp1 += e[k]; } if(tmp1==sum/3){ std::cout << "Yes" << std::endl; return 0; } } } std::cout << "No" << std::endl; }