#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7, n = 111;
long long c[n][n], dp[n][n], a[11];
int main() {
  c[0][0] = 1;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (i) {
        c[i][j] = c[i - 1][j];
      }
      if (min(i, j)) {
        c[i][j] = (c[i][j] + c[i - 1][j - 1]) % md;
      }
    }
  int n;
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) {
    scanf("%d", &a[i]);
  }
  for (int i = a[9]; i <= n; i++) {
    dp[9][i] = 1;
  }
  for (int num = 8; num; num--)
    for (int prevLen = 0; prevLen <= n; prevLen++)
      for (int len = a[num]; len + prevLen <= n; len++) {
        dp[num][len + prevLen] =
            (dp[num][len + prevLen] +
             dp[num + 1][prevLen] * c[len + prevLen][len] % md) %
            md;
      }
  for (int prevLen = 0; prevLen <= n; prevLen++)
    for (int len = a[0]; len + prevLen <= n; len++)
      if (len + prevLen) {
        dp[0][len + prevLen] =
            (dp[0][len + prevLen] +
             dp[1][prevLen] * c[len + prevLen - 1][len] % md) %
            md;
      }
  long long ans = 0;
  for (int i = 0; i <= n; i++) {
    ans = (ans + dp[0][i]) % md;
  }
  printf("%lld", ans);
}
