#include <bits/stdc++.h>
using namespace std;
long long c[110][110];
long long a[110];
long long tmp[110];
long long dp[10][110];
long long gao(long long n) {
  memset(dp, 0, sizeof(dp));
  long long i, j, k;
  long long m = 0;
  for (i = 0; i <= 9; i++) m += a[i];
  if (m > n) return 0;
  for (i = a[0]; i <= n; i++) {
    dp[0][i] = c[n][i];
  }
  for (i = 1; i <= 9; i++)
    for (j = 0; j <= n; j++) {
      for (k = a[i]; k <= j; k++) {
        dp[i][j] =
            (dp[i][j] + dp[i - 1][j - k] * c[n - (j - k)][k] % 1000000007) %
            1000000007;
      }
    }
  return dp[9][n] % 1000000007;
}
int main() {
  long long i, j, m, n;
  for (i = 0; i < 110; i++)
    for (j = 0; j < 110; j++) {
      if (j > i) {
        c[i][j] = 0;
        continue;
      }
      if (j == 0)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
    }
  while (cin >> n) {
    m = 0;
    for (i = 0; i <= 9; i++) {
      cin >> a[i];
      tmp[i] = a[i];
      m += a[i];
    }
    if (m > n) {
      cout << 0 << endl;
      continue;
    }
    long long res = 0;
    for (long long l = max(1LL, m); l <= n; l++) {
      for (i = 0; i <= n; i++) a[i] = tmp[i];
      long long ans = 0;
      for (i = 1; i <= 9; i++) {
        long long tt = a[i];
        a[i] = max(a[i] - 1, 0LL);
        ans = (ans + gao(l - 1)) % 1000000007;
        a[i] = tt;
      }
      res = (res + ans) % 1000000007;
    }
    cout << res << endl;
  }
  return 0;
}
