#include <bits/stdc++.h>
const int mod = 1000000007;
using namespace std;
int num[20];
long long dp[16][128];
int C[128][128];
void init() {
  int i, j;
  for (i = 0; i < 128; ++i) C[i][i] = C[i][0] = 1;
  for (i = 2; i < 128; ++i)
    for (j = 1; j < i; ++j) {
      C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
      C[i][j] %= mod;
    }
}
int main() {
  int i, j, k, n;
  init();
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < 10; ++i) scanf("%d", &num[i]);
    memset(dp, 0, sizeof(dp));
    dp[10][0] = 1;
    for (i = 9; i > 0; --i) {
      for (j = num[i]; j <= n; ++j) {
        for (k = 0; k + num[i] <= j; ++k)
          if (dp[i + 1][k]) {
            dp[i][j] += dp[i + 1][k] * C[j][k];
            dp[i][j] %= mod;
          }
      }
    }
    for (j = num[0] + 1; j <= n; ++j)
      for (k = 1; k + num[0] <= j; ++k)
        if (dp[1][k]) {
          dp[0][j] += dp[i + 1][k] * C[j - 1][k - 1];
          dp[0][j] %= mod;
        }
    k = 0;
    for (i = 1; i <= n; ++i) {
      k += dp[0][i];
      k %= mod;
    }
    printf("%d\n", k);
  }
  return 0;
}
