#include <bits/stdc++.h>
long long comb[101][101];
long long f[10][101];
int main() {
  int n, a[10], i, j, k;
  long long ans;
  scanf("%d", &n);
  for (i = 0; i < 10; i++) scanf("%d", &a[i]);
  comb[0][0] = comb[1][0] = comb[1][1] = 1;
  for (i = 2; i <= n; i++) {
    comb[i][0] = 1;
    for (j = 1; j <= i; j++) {
      comb[i][j] = (comb[i - 1][j] + comb[i - 1][j - 1]) % 1000000007;
    }
  }
  for (i = 0; i < a[9] && i <= n; i++) f[9][i] = 0;
  for (; i <= n; i++) f[9][i] = 1;
  for (i = 8; i > 0; i--) {
    for (j = 0; j <= n; j++) {
      f[i][j] = 0;
      for (k = a[i]; k <= j; k++) {
        f[i][j] = (f[i][j] + (comb[j][k] * f[i + 1][j - k]) % 1000000007) %
                  1000000007;
      }
    }
  }
  for (j = 1; j <= n; j++) {
    f[0][j] = 0;
    for (k = a[0]; k <= j - 1 && k <= n; k++) {
      f[0][j] =
          (f[0][j] + (comb[j - 1][k] * f[1][j - k]) % 1000000007) % 1000000007;
    }
  }
  ans = 0;
  for (i = 1; i <= n; i++) ans = (ans + f[0][i]) % 1000000007;
  printf("%I64d\n", ans);
  return 0;
}
