#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int comb[105][105], n;
int dp[11][105], a[10];
void compute() {
  memset(comb, 0, sizeof(comb));
  for (int i = 0; i < 105; i++) {
    comb[i][0] = 1;
  }
  for (int i = 1; i < 105; i++) {
    for (int j = 1; j <= i; j++) {
      comb[i][j] = (long long)(comb[i - 1][j] + comb[i - 1][j - 1]) % mod;
    }
  }
}
int main() {
  cin >> n;
  for (int i = 0; i < 10; i++) {
    cin >> a[i];
  }
  compute();
  memset(dp, 0, sizeof(dp));
  for (int i = 0; i <= n; i++)
    if (i >= a[9]) dp[9][i] = 1;
  for (int i = 8; i >= 0; i--) {
    for (int j = (i ? 0 : 1); j <= n; j++) {
      for (int k = a[i]; k <= j; k++) {
        dp[i][j] +=
            ((long long)dp[i + 1][j - k] * comb[(i ? j : (j - 1))][k]) % mod;
        dp[i][j] %= mod;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= n; i++) {
    ans += dp[0][i];
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}
