#include <bits/stdc++.h>
using namespace std;
long long dp[10][101];
long long c[101][101];
int n, a[10];
int main() {
  for (int i = 0; i <= 100; i++) c[0][i] = c[i][i] = 1;
  for (int i = 1; i <= 100; i++)
    for (int j = i + 1; j <= 100; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i][j - 1]) % 1000000007;
  while (cin >> n) {
    for (int d = 0; d <= 9; d++) cin >> a[d];
    memset(dp, 0, sizeof dp);
    for (int len = a[9]; len <= n; len++) dp[9][len] = 1;
    for (int d = 8; d >= 0; d--)
      for (int j = a[d]; j <= n; j++)
        for (int k = 0; k <= n; k++) {
          if (j + k <= n) {
            if (d != 0)
              dp[d][j + k] =
                  (dp[d][j + k] + dp[d + 1][k] * c[j][j + k]) % 1000000007;
            else
              dp[d][j + k] =
                  (dp[d][j + k] + dp[d + 1][k] * c[j][j + k - 1]) % 1000000007;
          }
        }
    long long ans = 0;
    for (int len = 1; len <= n; len++) ans = (ans + dp[0][len]) % 1000000007;
    cout << ans << endl;
  }
  return 0;
}
