#include <bits/stdc++.h>
using namespace std;
long long n, i, l, j, k, ans = 0ll, a[11], dp[111][111], c[111][111];
int main() {
  for (i = 0; i <= 100; i++) {
    c[i][0] = 1;
    for (l = 1; l <= i; l++) {
      c[i][l] = (c[i - 1][l - 1] + c[i - 1][l]) % 1000000007;
    }
  }
  dp[10][0] = 1;
  scanf("%lld", &n);
  for (i = 0; i < 10; i++) scanf("%lld", &a[i]);
  for (i = 9; i > 0; i--) {
    for (l = 0; l <= n; l++) {
      k = 0;
      for (j = a[i]; j <= l; j++)
        k = (k + dp[i + 1][l - j] * c[l][j]) % 1000000007;
      dp[i][l] = k;
    }
  }
  for (i = a[0]; i <= n; i++) {
    for (l = a[0]; l < i; l++) {
      ans = (ans + dp[1][i - l] * c[i - 1][l]) % 1000000007;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
