#include <bits/stdc++.h>
using namespace std;
long long dp[110][20];
const long long MOD = 1000000007LL;
int a[20];
long long c[110][110];
int main() {
  c[0][0] = c[1][0] = c[1][1] = 1;
  for (int i = 2; 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;
  while (scanf("%d", &n) == 1) {
    int sum = 0;
    for (int i = 0; i < 10; i++) {
      scanf("%d", &a[i]);
      sum += a[i];
    }
    if (sum > n)
      puts("0");
    else {
      long long sum = 0;
      for (int len = sum; len <= n; len++) {
        memset(dp, 0, sizeof(dp));
        dp[0][0] = 1;
        for (int i = 0; i < 10; i++) {
          int up = len;
          if (i == 0) up = len - 1;
          for (int j = up; j >= 0; j--)
            for (int k = j; k >= a[i]; k--) {
              dp[j][i + 1] += (dp[j - k][i] * c[up - (j - k)][k]) % MOD;
              dp[j][i + 1] %= MOD;
            }
        }
        sum += dp[len][10];
        sum %= MOD;
      }
      printf("%I64d\n", sum);
    }
  }
  return 0;
}
