#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int add(int a, int b) { return a + b < mod ? a + b : a + b - mod; }
int mul(int a, int b) { return int(1LL * a * b % mod); }
int fexp(int b, int e = mod - 2) {
  int ans = 1;
  while (e) {
    if (e & 1) ans = mul(ans, b);
    b = mul(b, b);
    e /= 2;
  }
  return ans;
}
const int N = 105;
int fat[N], ifat[N];
int n;
int a[10];
int dp[10][N];
int f(int i, int j) {
  if (j > n - 1) return 0;
  if (i == 10) return fat[j];
  int &ans = dp[i][j];
  if (~ans) return ans;
  ans = 0;
  for (int k = a[i]; j + k <= n; k++) {
    ans = add(ans, mul(f(i + 1, j + k), ifat[k]));
  }
  return ans;
}
int main() {
  fat[0] = 1;
  for (int i = 1; i < N; i++) fat[i] = mul(i, fat[i - 1]);
  ifat[N - 1] = fexp(fat[N - 1]);
  for (int i = N - 2; i >= 0; i--) ifat[i] = mul(i + 1, ifat[i + 1]);
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) scanf("%d", a + i);
  int ans = 0;
  for (int i = 1; i < 10; i++) {
    int old = a[i];
    if (a[i]) a[i]--;
    memset(dp, -1, sizeof dp);
    ans = add(ans, f(0, 0));
    a[i] = old;
  }
  printf("%d\n", ans);
}
