#include <bits/stdc++.h>
using namespace std;
const int INT_INF = 0x3fffffff;
const int MOD = 1000000007;
int a[20];
long long f[24][205], C[205][205];
int main() {
  memset(C, 0, sizeof(C));
  C[0][0] = 1;
  for (int i = 1; i < 205; i++)
    for (int j = 0; j <= i; j++)
      if (j == 0)
        C[i][j] = 1;
      else
        C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % MOD;
  int n;
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> a[i];
  memset(f, 0, sizeof(f));
  f[10][0] = 1;
  for (int i = 9; i > 0; i--)
    for (int j = 0; j <= n; j++)
      for (int k = a[i]; k <= j; k++)
        f[i][j] = (f[i][j] + f[i + 1][j - k] * C[j][k]) % MOD;
  long long ans = 0;
  for (int i = 0; i <= n; i++)
    for (int j = a[0]; j < i; j++)
      ans = (ans + f[1][i - j] * C[i - 1][j]) % MOD;
  cout << ans << endl;
  return 0;
}
