#include <bits/stdc++.h>
using namespace std;
const long long maxN = 1e2 + 17, MOD = 1e9 + 7, inf = 1e9, N = 1e4 + 7;
long long n, m, ans, a[10], s[20], c[1000][1000], dp[20][maxN], d[20][maxN],
    help;
int main() {
  cin >> n;
  for (unsigned long long int i = 0; i < 10; i++) cin >> a[i];
  s[9] = a[9];
  for (long long i = 8; i >= 0; i--) s[i] = s[i + 1] + a[i];
  for (long long i = 0; i <= 100; i++) c[1][i] = i, c[0][i] = 1;
  for (long long i = 2; i <= 1000; i++) {
    for (long long j = i; j <= 1000; j++)
      c[i][j] = c[i][j - 1] + c[i - 1][j - 1], c[i][j] %= MOD;
  }
  for (long long i = a[9]; i <= n; i++) dp[9][i] = 1;
  for (long long i = 8; i > 0; i--) {
    for (long long j = a[i]; j <= n; j++) {
      for (long long x = a[i]; x <= j; x++)
        dp[i][j] += (c[x][j] * dp[i + 1][j - x]), dp[i][j] %= MOD;
    }
  }
  for (long long j = a[0]; j <= n; j++) {
    for (long long x = a[0]; x <= j; x++)
      dp[0][j] += (c[x][j - 1] * dp[1][j - x]), dp[0][j] %= MOD;
  }
  if (s[0])
    for (long long i = s[0]; i <= n; i++) ans += dp[0][i], ans %= MOD;
  else
    for (long long i = s[0] + 1; i <= n; i++) ans += dp[0][i], ans %= MOD;
  return cout << ans % MOD << "\n", 0;
}
