#include <bits/stdc++.h>
using namespace std;
long long pas[110][110];
void isnt() {
  memset(pas, 0, sizeof(pas));
  for (long long n = 0; n < 110; n += 1) {
    pas[n][0] = 0;
    pas[n][n] = 1;
    for (long long m = 0; m < n; m += 1)
      pas[n][m] = (pas[n - 1][m - 1] + pas[n - 1][m]) % 1000000007;
  }
}
long long fact(int n, int m) {
  assert(n < 110);
  assert(m < 110);
  if (n < m) return 0;
  return pas[n][m];
}
long long dp[110][11];
int main() {
  isnt();
  int n, ar[10], sum = 0;
  cin >> n;
  for (long long i = 0; i < 10; i += 1) cin >> ar[i], sum += ar[i];
  memset(dp, 0, sizeof(dp));
  for (long long i = ar[9]; i < n + 1; i += 1) dp[i][9] = 1;
  for (long long num = 8; num > 0 - 1; num -= 1)
    for (long long len = ar[num]; len < n + 1; len += 1)
      for (long long k = ar[num]; k < len + 1; k += 1)
        dp[len][num] +=
            (dp[len - k][num + 1] * fact(len - (num == 0), k)) % 1000000007,
            dp[len][num] %= 1000000007;
  long long res = 0;
  for (long long len = 0; len < n + 1; len += 1)
    res += dp[len][0], res %= 1000000007;
  cout << res << endl;
  return 0;
}
