#include <bits/stdc++.h>
using namespace std;
long long int modulo = 1000000007;
long long int memcolocar[105][105];
long long int colocar(int posiciones, int amount) {
  if (amount == 0) return 1;
  if (posiciones == 0) return 0;
  long long int &mem = memcolocar[posiciones][amount];
  if (mem != -1) return mem;
  mem = 0;
  for (int i = 0; i <= amount; i++) {
    mem = (mem + colocar(posiciones - 1, amount - i)) % modulo;
  }
  return mem;
}
long long int a[10];
long long int suma[10];
long long int memcalculo[10][101];
long long int calculo(int indice, int ademas) {
  if (indice == 0) return 1;
  long long int &mem = memcalculo[indice][ademas];
  if (mem != -1) return mem;
  mem = 0;
  for (int prevademas = 0; prevademas <= ademas; prevademas++) {
    if (prevademas == 0 and indice == 9 and suma[indice - 1] == 0) continue;
    int cuantosantes = suma[indice - 1] + prevademas;
    long long int manerasantes = calculo(indice - 1, prevademas);
    int posicionesantes = cuantosantes + 1;
    if (indice == 9) posicionesantes--;
    mem = (mem + manerasantes * colocar(posicionesantes,
                                        a[indice] + ademas - prevademas)) %
          modulo;
  }
  return mem;
}
int main() {
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 101; j++) memcalculo[i][j] = -1;
  for (int i = 0; i < 105; i++)
    for (int j = 0; j < 105; j++) memcolocar[i][j] = -1;
  int n;
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> a[i];
  reverse(a, a + 10);
  suma[0] = a[0];
  for (int i = 1; i < 10; i++) suma[i] = suma[i - 1] + a[i];
  int ademas = n - suma[9];
  if (ademas < 0) {
    cout << 0 << endl;
    exit(0);
  }
  long long int acum = 0;
  for (int i = 0; i <= ademas; i++) acum = (acum + calculo(9, i)) % modulo;
  cout << acum << endl;
}
