#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
const long long mod = 1000000007;
long long dp[15][maxn][maxn], f[15][maxn];
long long C[maxn][maxn];
int a[15];
long long process(int n) {
  a[0] = a[0] < 0 ? 0 : a[0];
  for (int i = a[0]; i <= n; i++) {
    dp[0][i][i] = 1;
    f[0][i] = 1;
  }
  int s = a[0];
  for (int i = 1; i <= 9; i++) {
    s += a[i];
    for (int j = s; j <= n; j++) {
      for (int k = a[i]; k <= n; k++) {
        dp[i][j][k] = C[j][k] * f[i - 1][j - k] % mod;
        f[i][j] = (f[i][j] + dp[i][j][k]) % mod;
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = (ans + f[9][i]) % mod;
  }
  return ans;
}
int main() {
  C[0][0] = 1;
  for (int i = 1; i < maxn; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
  for (int n, flag; scanf("%d", &n) != EOF;) {
    flag = 1;
    for (int i = 0; i <= 9; i++) {
      scanf("%d", &a[i]);
      if (a[i] > 0) flag = 0;
    }
    memset(dp, 0, sizeof(dp));
    memset(f, 0, sizeof(f));
    long long ans = process(n);
    a[0]--;
    memset(dp, 0, sizeof(dp));
    memset(f, 0, sizeof(f));
    long long tmp = process(n - 1);
    ans = (ans - tmp) % mod;
    printf("%I64d\n", (ans + mod - flag) % mod);
  }
  return 0;
}
