#include <bits/stdc++.h>
using namespace std;
int A[10], dp[105][10], C[105][105], n;
inline void Add(int &x, int y) {
  x += y;
  if (x >= 1000000007) x -= 1000000007;
}
void Init() {
  C[0][0] = 1;
  for (int i = (1), i_ = (n); i <= i_; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = (1), j_ = (i - 1); j <= j_; j++)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000007;
  }
}
int main() {
  scanf("%d", &n);
  Init();
  for (int i = (0), i_ = (9); i <= i_; i++) scanf("%d", &A[i]);
  for (int i = (A[9]), i_ = (n); i <= i_; i++) dp[i][9] = 1;
  for (int j = (8), j_ = (0); j >= j_; j--)
    for (int i = (A[j]), i_ = (n); i <= i_; i++) {
      for (int k = (A[j]), k_ = (i); k <= k_; k++)
        Add(dp[i][j], 1LL * dp[i - k][j + 1] * C[i - (j == 0)][k] % 1000000007);
    }
  int ans = 0;
  for (int i = (0), i_ = (n); i <= i_; i++) {
    Add(ans, dp[i][0]);
  }
  printf("%d\n", ans);
  return 0;
}
