#include <bits/stdc++.h>
const double eps = 1e-10;
using namespace std;
int n, i, j, k, m, q, r, b;
int f[155], dp[155][155], a[155];
double ways[155][155], maxW;
long long C[155][155];
int maximal, pas;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) cin >> a[i];
  for (i = 0; i < n + 1; i++) C[0][i] = 1;
  for (int i = 0; i <= n; i++) {
    for (int j = 1; j <= i; j++) {
      C[j][i] = (C[j][i - 1] + C[j - 1][i - 1]) % 1000000007;
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int j = 9; j >= 0; j--) {
      if (j == 0) {
        for (int x = a[0]; x <= 101; x++) {
          if (i >= x)
            dp[i][j] = (dp[i][j] + dp[i - x][1] * C[x][i - 1]) % 1000000007;
        }
      } else if (j < 9) {
        for (int x = a[j]; x <= 100; x++) {
          dp[i][j] = (dp[i][j] + dp[i - x][j + 1] * C[x][i]) % 1000000007;
        }
      } else {
        if (i >= a[9]) dp[i][9] = 1;
      }
    }
  }
  while (n--) pas = (pas + dp[n + 1][0]) % 1000000007;
  cout << pas << endl;
  return 0;
}
