#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:66777216")
using namespace std;
int a, b, c, d, i, j, n, m, k;
int ce[102][102];
int dp[102][11], lim[11];
int main() {
  for (int _n((102) - 1), i(0); i <= _n; i++) {
    ce[i][0] = ce[i][i] = 1;
    for (int _n((i - 1)), j(1); j <= _n; j++) {
      ce[i][j] = (ce[i - 1][j - 1] + ce[i - 1][j]) % 1000000007;
    }
  }
  scanf("%d", &n);
  for (int _n((10) - 1), i(0); i <= _n; i++) scanf("%d", &lim[i]);
  dp[0][10] = 1;
  for (int _n((n + 1) - 1), len(0); len <= _n; len++) {
    for (int i = (10), _b = (1); i >= _b; i--) {
      if (!dp[len][i]) continue;
      for (int _n(n), j(lim[i - 1]); j <= _n; j++) {
        if (len + j > n) break;
        int cpos = len + j;
        if (i == 1 && !len) continue;
        if (i == 1) --cpos;
        dp[len + j][i - 1] =
            (dp[len + j][i - 1] + (long long)dp[len][i] * ce[cpos][j]) %
            1000000007;
      }
    }
  }
  int ans = 0;
  for (int _n((n)), len(1); len <= _n; len++)
    ans = (ans + dp[len][0]) % 1000000007;
  printf("%d\n", ans);
}
