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