#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long dp[105][105], C[105][105];
int a[105];
int main() {
  C[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % mod;
  }
  int N;
  scanf("%d", &N);
  for (int i = 0; i < 10; i++) scanf("%d", &a[i]);
  long long ans = 0;
  for (int n = N; n >= 1; n--) {
    memset(dp, 0, sizeof(dp));
    dp[0][n] = 1;
    for (int i = 0; i < 10; i++)
      for (int j = 0; j <= n; j++)
        if (dp[i][j]) {
          for (int k = a[i]; k <= j; k++)
            dp[i + 1][j - k] += dp[i][j] * C[j][k], dp[i + 1][j - k] %= mod;
        }
    long long ret = dp[10][0];
    int xx = a[0];
    if (a[0]) a[0]--;
    memset(dp, 0, sizeof(dp));
    dp[0][n - 1] = 1;
    for (int i = 0; i < 10; i++)
      for (int j = 0; j <= n - 1; j++)
        if (dp[i][j]) {
          for (int k = a[i]; k <= j; k++)
            dp[i + 1][j - k] += dp[i][j] * C[j][k], dp[i + 1][j - k] %= mod;
        }
    ret -= dp[10][0];
    ret %= mod;
    ans += ret;
    ans %= mod;
    a[0] = xx;
  }
  printf("%I64d\n", (ans + mod) % mod);
  return 0;
}
