#include <bits/stdc++.h>
using namespace std;
const int maxn = 101;
const int oo = 1000000007;
int f[11][maxn], c[maxn][maxn];
int a[maxn];
int n;
int main() {
  int i, j, k;
  c[0][0] = 1;
  for (i = 1; i < maxn; i++) {
    c[i][0] = 1;
    for (j = 1; j <= i; j++) c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % oo;
  }
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) scanf("%d", &a[i]);
  f[10][0] = 1;
  for (i = 9; i; i--)
    for (j = a[i]; j <= n; j++)
      for (k = a[i]; k <= j; k++)
        f[i][j] = (f[i][j] + ((long long)f[i + 1][j - k] * c[j][k]) % oo) % oo;
  for (j = max(a[i], 1); j <= n; j++)
    for (k = a[i]; k <= j; k++)
      f[i][j] =
          (f[i][j] + ((long long)f[i + 1][j - k] * c[j - 1][k]) % oo) % oo;
  k = 0;
  for (i = 1; i <= n; i++) k = (k + f[0][i]) % oo;
  printf("%d\n", k);
  return 0;
}
