#include #include #include #include #include #include #include #include #include #include #define mkp make_pair #define mkt make_tuple #define rep(i,n) for(int i = 0; i < (n); ++i) #define all(v) v.begin(),v.end() using namespace std; typedef long long ll; const ll MOD=1e9+7; template void chmin(T &a,const T &b){if(a>b) a=b;} template void chmax(T &a,const T &b){if(a>N; vector A(N); rep(i,N) cin>>A[i]; vector sum(N+1,0); rep(i,N) sum[i+1]=sum[i]+A[i]; vector>> dp(N+1,vector> (1< (2,0))); dp[0][0][0]=1; ll num=0; for(int i=0;i