#include <bits/stdc++.h>
using namespace std;
int n, m, p[10] = {0}, dp[110][10] = {0}, len;
long long ncr[110][110] = {0}, ans = 0;
int main() {
  for (int i = (0); i <= (100); i++) ncr[i][0] = 1;
  for (int i = (1); i <= (100); i++)
    for (int j = (1); j <= (i); j++)
      ncr[i][j] = (ncr[i - 1][j] + ncr[i - 1][j - 1]) % 1000000007;
  scanf("%d", &n);
  for (int i = (0); i < (10); i++) scanf("%d", p + i);
  for (int i = (p[1]); i <= (n); i++) dp[i][1] = 1;
  len = p[1];
  for (int i = (2); i < (10); i++) {
    for (int j = (len + p[i]); j <= (n); j++)
      for (int k = (len); k <= (j - p[i]); k++)
        dp[j][i] = (dp[j][i] + dp[k][i - 1] * ncr[j][k]) % 1000000007;
    len += p[i];
  }
  for (int i = (len); i <= (n - p[0]); i++)
    for (int j = (i + p[0]); j <= (n); j++)
      ans = (ans + dp[i][9] * ncr[j - 1][j - i]) % 1000000007;
  printf("%d\n", ans);
  return 0;
}
