#include <bits/stdc++.h>
using namespace std;
int a[10], dp[110][110], c[110][110];
int main() {
  int n, i, j, k;
  for (i = 0; i <= 100; i++) {
    c[i][0] = 1;
    for (j = 1; j <= i; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
  }
  while (~scanf("%d", &n)) {
    for (i = 0; i < 10; i++) {
      scanf("%d", &a[i]);
    }
    memset(dp, 0, sizeof(dp));
    for (i = a[1]; i <= n; i++) dp[1][i] = 1;
    for (i = 2; i <= 9; i++)
      for (j = a[i]; j <= n; j++)
        for (k = a[i]; k <= j; k++)
          dp[i][j] =
              (dp[i][j] + (unsigned long long)dp[i - 1][j - k] * c[j][k]) %
              1000000007;
    unsigned long long ans = 0;
    for (j = a[0]; j <= n; j++)
      for (k = a[0]; k < j; k++)
        ans =
            (ans + (unsigned long long)dp[9][j - k] * c[j - 1][k]) % 1000000007;
    printf("%I64d\n", ans);
  }
  return 0;
}
