#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
long long c[210][210], dp[110][110];
int main() {
  memset(dp, 0, sizeof(dp));
  memset(c, 0, sizeof(c));
  int a[10];
  for (int i = 0; i < 210; i++) {
    c[i][i] = c[i][0] = 1;
    for (int j = 1; j < i; j++) {
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
    }
  }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) scanf("%d", &a[i]);
  if (n == 1) {
    int tot = 0;
    for (int i = 1; i < 10; i++) a[i] += a[i - 1];
    if (a[9] > 1) {
      printf("0\n");
      return 0;
    }
    if (a[9] == 0) {
      printf("10\n");
      return 0;
    }
    printf("1\n");
    return 0;
  }
  for (int i = a[9]; i <= n; i++) dp[9][i] = 1;
  for (int i = 8; i >= 0; i--) {
    if (i) {
      for (int j = n; j >= a[i]; j--) {
        for (int k = a[i]; k <= j; k++) {
          dp[i][j] = (dp[i][j] + dp[i + 1][j - k] * c[j][k]) % mod;
        }
      }
    } else {
      for (int j = n; j >= a[i]; j--) {
        for (int k = a[i]; k < j; k++) {
          dp[i][j] = (dp[i][j] + dp[i + 1][j - k] * c[j - 1][k]) % mod;
        }
      }
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) ans = (ans + dp[0][i]) % mod;
  cout << ans << endl;
  return 0;
}
