#include <bits/stdc++.h>
const int N = 110;
const int inf = 0x3f3f3f3f;
const long long mod = 1000000007ll;
using namespace std;
int n, a[110];
long long c[N][110];
void init() {
  c[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= 100; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % mod;
  }
}
long long dp[11][N];
long long solve(int n, int a[]) {
  init();
  memset(dp, 0, sizeof(dp));
  dp[0][0] = 1;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j <= n; j++) {
      if (dp[i][j] == 0) continue;
      for (int k = a[i + 1]; k + j <= n; k++)
        dp[i + 1][j + k] = (dp[i][j] * c[j + k][k] + dp[i + 1][j + k]) % mod;
    }
  }
  return dp[10][n];
}
int main() {
  int sum = 0;
  scanf("%d", &n);
  for (int i = 1; i <= 10; i++) scanf("%d", &a[i]), sum += a[i];
  if (sum > n) {
    printf("0\n");
    return 0;
  }
  long long ret = 0;
  for (int k = max(1, sum); k <= n; k++) {
    if (k == 1) {
      if (sum == 1)
        ret++;
      else
        ret += 9;
      continue;
    }
    for (int i = 2; i <= 10; i++) {
      int f = 1;
      if (a[i] == 0) f = 0;
      a[i] -= f;
      ret += solve(k - 1, a);
      ret %= mod;
      a[i] += f;
    }
  }
  cout << (ret % mod) << endl;
  return 0;
}
