#include <bits/stdc++.h>
int fac[1 + 100], ifac[1 + 100];
int max(int a, int b) {
  if (a > b) return a;
  return b;
}
int add(long a, int b) { return (a + b) % 1000000007; }
int mul(int a, int b) { return (long long)a * b % 1000000007; }
int pow(int a, int b) {
  if (b == 0) return 1;
  int val = pow(mul(a, a), b / 2);
  if (b % 2 == 1) val = mul(val, a);
  return val;
}
void pre(int n) {
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = mul(fac[i - 1], i);
  ifac[0] = 1;
  for (int i = 1; i <= n; i++)
    ifac[i] = mul(ifac[i - 1], pow(i, 1000000007 - 2));
}
int sol(int n, int a[10]) {
  int ans = 0, dp[1 + 10][1 + 100] = {0};
  dp[0][0] = 1;
  for (int i = 0; i < 10; i++)
    for (int j = 0; j <= n; j++)
      for (int k = max(a[i], 0); j + k <= n; k++)
        dp[i + 1][j + k] = add(dp[i + 1][j + k], mul(dp[i][j], ifac[k]));
  for (int i = 0; i <= n; i++) ans = add(ans, mul(fac[i], dp[10][i]));
  return ans;
}
int main() {
  int n, a[10], ans = 0;
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) scanf("%d", &a[i]);
  pre(n);
  for (int i = 1; i < 10; i++) {
    a[i]--;
    ans = add(ans, sol(n - 1, a));
    a[i]++;
  }
  printf("%d\n", ans);
  return 0;
}
