#include "bits/stdc++.h" using namespace std; #define print(x) cout< PI; typedef pair V; typedef vector VE; const ll mod = 1000000007; //10^9+7 int n; int m[16]; int dp[500000]; int main(){ cin>>n; REP(i,n)cin>>m[i]; REP(i,50000)dp[i]=mod; dp[0]=0; rep(i,1,1<