#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007ll;
int comb[101][101];
long long Comb(int n, int k) {
  if (comb[n][k]) return comb[n][k];
  if (n == k || k == 0) return comb[n][k] = 1;
  return comb[n][k] = (Comb(n - 1, k) + Comb(n - 1, k - 1)) % MOD;
}
long long dp[10][101][101];
int Solve(const int n, const int *a) {
  long long m = 0;
  for (int i = 0; i < 10; ++i) m = m + a[i];
  long long sum = 0;
  for (; m <= n; ++m) {
    memset(dp, 0, sizeof(dp));
    for (int i = a[0]; i <= m - 1; ++i) dp[0][i][i] = Comb(m - 1, i);
    for (int d = 1; d < 10; ++d) {
      for (int k = 0; k <= m; ++k) {
        for (int j = 0; j <= k; ++j) {
          for (int i = a[d]; i <= m - k; ++i) {
            long long add = dp[d - 1][k][j] * Comb(m - k, i) % MOD;
            dp[d][k + i][i] = (dp[d][k + i][i] + add) % MOD;
          }
        }
      }
    }
    for (int i = a[9]; i <= m; ++i) sum = (sum + dp[9][m][i]) % MOD;
  }
  return sum;
}
int main(void) {
  int a[10], n;
  cin >> n;
  for (int i = 0; i < 10; ++i) cin >> a[i];
  cout << Solve(n, a) << "\n";
  return 0;
}
