#include <bits/stdc++.h>
using namespace std;
const int maxn = 100, maxd = 10;
const long long int mode = 1e9 + 7;
int leas[maxd];
long long int c[maxn + 1][maxn + 1];
long long int dp[maxd][maxn + 1], dps[maxn];
int main() {
  for (int i = 0; i < maxn + 1; i++) {
    c[i][0] = 1;
    for (int j = 1; j < i + 1; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mode;
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) scanf("%d", leas + i);
  for (int i = leas[9]; i < maxn + 1; i++) dp[9][i] = 1;
  for (int i = 8; i > -1; i--)
    for (int j = leas[i]; j < maxn + 1; j++)
      for (int k = leas[i]; k < j + 1; k++)
        dp[i][j] = (dp[i][j] + c[j][k] * dp[i + 1][j - k]) % mode;
  int lease = max(leas[0] - 1, 0);
  for (int j = lease; j < maxn + 1; j++)
    for (int k = lease; k < j + 1; k++)
      dps[j] = (dps[j] + c[j][k] * dp[1][j - k]) % mode;
  if (n == 1)
    printf("%I64d", dp[1][1]);
  else {
    long long int ans = dp[1][1] * (leas[0] == 0);
    for (int i = 2; i < n + 1; i++)
      ans = (ans + dp[0][i] - dps[i - 1] + mode) % mode;
    printf("%I64d", ans);
  }
}
