#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<vector<int> > C(n + 1, vector<int>(n + 1, 0));
  for (int i = 0; i < (int)(n + 1); ++i) {
    C[i][0] = 1;
    for (int j = (int)(1); j <= (int)(i); ++j)
      C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % 1000000007;
  }
  vector<int> A(10);
  for (int i = 0; i < (int)(10); ++i) scanf("%d", &A[i]);
  vector<vector<int> > D(11, vector<int>(n + 1, 0));
  for (int i = (int)(1); i <= (int)(n); ++i) D[0][i] = 1;
  for (int i = 0; i < (int)(10); ++i)
    for (int j = 0; j < (int)(n + 1); ++j) {
      int w = j - (i == 0);
      for (int k = (int)(A[i]); k <= (int)(w); ++k) {
        D[i + 1][j - k] += (long long)C[w][k] * D[i][j] % 1000000007;
        D[i + 1][j - k] %= 1000000007;
      }
    }
  printf("%d\n", D[10][0]);
}
