#include <bits/stdc++.h>
using namespace std;
long long C[105][105];
int num[10];
long long mod = 1000000007;
long long dp[15][105];
void init() {
  C[0][0] = 1;
  for (int i = 1; i <= 100; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
}
int main() {
  int n;
  init();
  while (~scanf("%d", &n)) {
    for (int i = 0; i <= 9; i++) scanf("%d", num + i);
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    for (int i = 1; i <= 9; i++) {
      for (int j = 0; j <= n; j++)
        if (dp[i - 1][j])
          for (int t = num[i]; j + t <= n; t++) {
            dp[i][j + t] = (dp[i][j + t] + C[j + t][t] * dp[i - 1][j]) % mod;
          }
    }
    long long res = 0;
    for (int i = 0; i <= n; i++)
      for (int j = num[0]; j + i <= n; j++) {
        res = (res + C[j + i - 1][j] * dp[9][i]) % mod;
      }
    cout << res << endl;
  }
  return 0;
}
