#include <bits/stdc++.h>
const int mod = 1000000007;
int c[103][103] = {0};
int dp[10][103];
int num[10];
int main() {
  int i, j, n, k, ans = 0, min = 0;
  for (i = 0; i < 103; i++) c[i][0] = c[i][i] = 1;
  for (i = 2; i < 103; i++)
    for (j = 1; j < i; j++) c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
  scanf("%d", &n);
  for (i = 0; i < 10; i++) {
    scanf("%d", num + i);
    min += num[i];
  }
  for (i = num[9]; i <= n; i++) dp[9][i] = 1;
  for (i = 8; i >= 0; i--) {
    for (j = num[i]; j <= n; j++)
      for (k = 0; k + j <= n; k++)
        dp[i][k + j] =
            (dp[i][k + j] +
             (1ll * dp[i + 1][k] * c[k + j - (i ? 0 : 1)][j]) % mod) %
            mod;
  }
  if (min == 0) {
    min = 1;
  }
  for (i = min; i <= n; i++) ans = (ans + dp[0][i]) % mod;
  printf("%d\n", ans);
  return 0;
}
