#include #include using namespace std; using namespace atcoder; using ll=long long; using ld=long double; ld pie=3.141592653589793; ll mod=1000000007; ll inf=9999999999999999; int main(){ ll n,k; cin >> n >> k; vectora(n); for (ll i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(),a.end()); vectorthr(21,1); for (ll i = 1; i < 21; i++) { thr[i]=thr[i-1]*3; } if (n>10) { mapmemo1; ll d=n-10; for (ll i = 0; i < thr[10]; i++) { ll now=0; vectorz(3,0); for (ll j = 0; j <10 ; j++) { ll x=i%thr[j+1]; x/=thr[j]; if (x==0) { now+=a[j]; }else if (x==1) { now-=a[j]; } z[x]+=1; } if (z[0]==10||z[1]==10||z[2]==10) { continue; } memo1[now]+=1; } mapmemo2; for (ll i = 0; i < thr[d]; i++) { ll now=0; vectorz(3,0); for (ll j = 0; j =1||memo2[v.first-k]>=1) { cout << "Yes" << endl; return 0; } } cout << "No" << endl; }else{ mapmemo1; for (ll i = 0; i < thr[n]; i++) { ll now=0; vectorz(3,0); for (ll j = 0; j =1) { cout << "Yes" << endl; }else{ cout << "No" << endl; } } }