#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:60777216")
using namespace std;
int d[10];
int c[107][107];
long long dp[107][17];
long long solve(int len, int pos) {
  if (pos == 9) {
    if (len >= d[9]) {
      return 1;
    }
    return 0;
  }
  if (dp[len][pos] != -1) {
    return dp[len][pos];
  }
  dp[len][pos] = 0;
  if (pos == 0) {
    for (int j = d[pos]; j <= len; ++j) {
      dp[len][pos] += solve(len - j, pos + 1) * c[len - 1][j] % 1000000007;
      if (dp[len][pos] >= 1000000007) dp[len][pos] -= 1000000007;
    }
  } else {
    for (int j = d[pos]; j <= len; ++j) {
      dp[len][pos] += solve(len - j, pos + 1) * c[len][j] % 1000000007;
      if (dp[len][pos] >= 1000000007) dp[len][pos] -= 1000000007;
    }
  }
  return dp[len][pos];
}
int main() {
  c[0][0] = 1;
  c[1][1] = 1;
  c[1][0] = 1;
  for (int i = 2; i <= 100; ++i) {
    c[i][i] = 1;
    c[i][0] = 1;
    for (int j = 1; j < i; ++j) {
      c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
      if (c[i][j] >= 1000000007) c[i][j] -= 1000000007;
    }
  }
  long long ans = 0;
  memset(dp, -1, sizeof(dp));
  int len;
  scanf("%d", &len);
  for (int i = 0; i < 10; ++i) {
    scanf("%d", d + i);
  }
  for (int i = 1; i <= len; ++i) {
    ans += solve(i, 0);
    if (ans >= 1000000007) ans -= 1000000007;
  }
  printf("%d\n", ans);
  return 0;
}
