#include #include #include using namespace std; using ll = long long; #include using mint = atcoder::modint1000000007; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int n; cin>>n; vector c(10,0); for(int i = 1;i<=9;i++) cin>>c[i]; mint ans = 0; vector p(n+1,0); p[0] = 1; for(int i = 1;i<=n;i++) p[i] = p[i-1] * 10; vector fac(n+1,1); for(int i = 1;i<=n;i++) fac[i] = fac[i-1] * i; vector ifac(n+1,1); ifac[n] = fac[n].inv(); for(int i = n-1;i>=0;i--) ifac[i] = ifac[i+1] * (i+1); for(int i = 1;i<=9;i++){ if(c[i]==0) continue; c[i]--; for(int j = 0;j