#include <bits/stdc++.h>
using namespace std;
const int N = 107;
const int MOD = 1e9 + 7;
int n, a[10], dp[N][N], c[N][N];
void inc(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
int main() {
  for (int i = (0); i < (N); ++i) {
    c[i][0] = c[i][i] = 1;
    for (int j = (1); j < (i); ++j)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % MOD;
  }
  scanf("%d", &n);
  for (int i = (0); i < (10); ++i) scanf("%d", a + i);
  dp[0][0] = 1;
  for (int i = (1); i < (10); ++i)
    for (int j = (a[i]); j < (n + 1); ++j)
      for (int k = (a[i]); k < (j + 1); ++k)
        inc(dp[i][j], 1ll * dp[i - 1][j - k] * c[j][k] % MOD);
  for (int j = (a[0] + 1); j < (n + 1); ++j)
    for (int k = (a[0]); k < (j); ++k)
      inc(dp[10][j], 1ll * dp[9][j - k] * c[j - 1][k] % MOD);
  int ans = 0;
  for (int i = (1); i < (n + 1); ++i) inc(ans, dp[10][i]);
  printf("%d", ans);
  return 0;
}
