#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 100 + 10;
long long dp[N][N], n, a[N], comb[N][N], mark[N][N];
long long C(int i, int j) {
  if (i > j || j < 0) return 0;
  if (!i || i == j) return 1;
  if (mark[i][j]) return comb[i][j];
  mark[i][j] = 1;
  return comb[i][j] = (C(i - 1, j - 1) + C(i, j - 1)) % mod;
}
int main() {
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> a[i];
  for (int i = a[9]; i <= n; i++) dp[i][9] = 1;
  for (int i = 0; i <= n; i++)
    for (int j = 8; j >= 0; j--)
      for (int k = a[j]; k <= i; k++)
        dp[i][j] += dp[i - k][j + 1] * C(k, i - (j == 0 ? 1 : 0)),
            dp[i][j] %= mod;
  long long ans = 0;
  for (int i = 1; i < n + 1; i++) ans += dp[i][0], ans %= mod;
  cout << ans << endl;
}
