#include <bits/stdc++.h>
using namespace std;
const int M = 1000000007;
long long fac[110], inv[110];
int n, c[20];
long long dp[15][110];
int solve() {
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 1; i <= 10; i++) {
    for (int j = max(0, c[i - 1]); j <= 100; j++)
      for (int k = 0; k <= 100; k++)
        if (j + k <= 100) {
          dp[i][j + k] += dp[i - 1][k] * inv[j] % M;
          dp[i][j + k] %= M;
        }
  }
  long long ans = 0;
  for (int i = 0; i <= n - 1; i++) ans = (ans + dp[10][i] * fac[i] % M) % M;
  return ans;
}
int main() {
  fac[0] = inv[0] = fac[1] = inv[1] = 1;
  for (int i = 2; i <= 100; i++)
    fac[i] = fac[i - 1] * i % M, inv[i] = (M - inv[M % i] * (M / i) % M) % M;
  for (int i = 2; i <= 100; i++) inv[i] = inv[i - 1] * inv[i] % M;
  while (~scanf("%d", &n)) {
    for (int i = 0; i <= 9; i++) scanf("%d", &c[i]);
    long long ans = 0;
    for (int i = 1; i <= 9; i++) {
      c[i]--;
      ans += solve();
      ans %= M;
      c[i]++;
    }
    printf("%I64d\n", ans);
  }
}
