#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007, maxN = 110;
long long f[11][maxN];
int n, a[10], C[maxN][maxN];
int main() {
  scanf("%d", &n);
  for (int i = 0; i <= 9; i++) scanf("%d", &a[i]);
  memset(f, 0, sizeof(f));
  f[10][0] = 1;
  memset(C, 0, sizeof(C));
  for (int i = 0; i <= n; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
  }
  for (int c = 9; c >= 0; c--) {
    for (int i = n; i >= 0; i--) {
      for (int j = i - a[c]; j >= 0; j--) {
        if (c > 0)
          f[c][i] = (f[c][i] + f[c + 1][j] * C[i][j]) % MOD;
        else if (i > 0 && j > 0)
          f[c][i] = (f[c][i] + f[c + 1][j] * C[i - 1][j - 1]) % MOD;
      }
    }
  }
  int res = 0;
  for (int i = 0; i <= n; i++) res = (res + f[0][i]) % MOD;
  printf("%d\n", res);
  return 0;
}
