#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int n;
int a[10];
long long f[11][111];
long long c[111][111];
long long dp(int n, int a[]) {
  memset(f, 0, sizeof(f));
  f[0][0] = 1;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j <= n; j++)
      if (f[i][j]) {
        for (int k = a[i]; j + k <= n; k++) {
          f[i + 1][j + k] += f[i][j] * c[n - j][k];
          f[i + 1][j + k] %= MOD;
        }
      }
  }
  return f[10][n];
}
int main(int argc, char *argv[]) {
  for (int i = 0; i <= 100; i++) {
    c[i][0] = 1;
    for (int j = 1; j <= i; j++) {
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD;
    }
  }
  scanf("%d", &n);
  int sumA = 0;
  for (int i = 0; i < 10; i++) {
    scanf("%d", &a[i]);
    sumA += a[i];
  }
  long long ans = 0;
  for (int i = 1; i < 10; i++) {
    int d = min(1, a[i]);
    a[i] -= d;
    for (int j = sumA; j <= n; j++) {
      ans += dp(j - 1, a);
      ans %= MOD;
    }
    a[i] += d;
  }
  printf("%I64d\n", ans % MOD);
  return 0;
}
