1 #include<iostream> 2 using namespace std; 3 int a[10001]; 4 int f(int n,int m) 5 { 6 if(m==0||m-a[n]==0)return 1; 7 if(n==1&&m-a[n]!=0)return 0; 8 else return f(n-1,m)+f(n-1,m-a[n]); 9 } 10 int main() 11 { 12 int n,m; 13 cin>>n; 14 for(int i=1;i<=n;i++) 15 { 16 cin>>a[i]; 17 } 18 cin>>m; 19 if(f(n,m)==1) 20 cout<<"yes"; 21 else cout<<"no"; 22 return 0; 23 }