#include <bits/stdc++.h>
using namespace std;
using namespace std;
int m, h, t, n, i, j, k, ans = 0, p;
int a[10], b[10];
long long c[200][200];
long long d[200][200];
int main() {
  cin >> n;
  for (i = 0; i < 10; i++) {
    cin >> a[i];
    b[i] = a[i];
  }
  for (i = 0; i <= 100; i++) c[i][0] = 1;
  for (i = 1; i <= 100; i++)
    for (j = 1; j <= i; j++)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 1000000007;
  n--;
  long long ans = 0;
  for (i = 1; i <= 9; i++) {
    for (j = 0; j <= 100; j++)
      for (k = 0; k <= 100; k++) d[j][k] = 0;
    if (a[i] > 0) a[i]--;
    d[0][0] = 1;
    for (j = 0; j <= 9; j++) {
      for (k = 0; k <= n; k++) {
        for (p = a[j]; p + k <= n; p++) {
          d[j + 1][k + p] += d[j][k] * c[p + k][p];
          d[j + 1][k + p] %= 1000000007;
        }
      }
    }
    for (j = 0; j <= n; j++) {
      ans += d[10][j];
      ans %= 1000000007;
    }
    a[i] = b[i];
  }
  cout << ans << endl;
  return 0;
}
