#include <bits/stdc++.h>
int c[111][111], dp[11][111];
int a[11], n;
int add(int x, int y) { return (x += y) < 1000000007 ? x : x - 1000000007; }
int mul(int x, int y) { return (int)((long long int)x * y % 1000000007); }
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= n; i++)
    for (int j = 0; j <= i; j++)
      c[i][j] = j == 0 || j == i ? 1 : add(c[i - 1][j], c[i - 1][j - 1]);
  dp[10][0] = 1;
  for (int i = 9; i >= 1; i--)
    for (int j = 0; j <= n; j++)
      if (dp[i + 1][j])
        for (int k = a[i]; j + k <= n; k++)
          dp[i][j + k] = add(dp[i][j + k], mul(dp[i + 1][j], c[j + k][k]));
  int res = 0;
  for (int j = 1; j <= n; j++)
    if (dp[1][j])
      for (int k = a[0]; j + k <= n; k++)
        res = add(res, mul(dp[1][j], c[j + k - 1][k]));
  printf("%d\n", res);
  return 0;
}
