#include <bits/stdc++.h>
using namespace std;
long long const BASE = 1000000007ll;
int n, a[11], sum;
long long ans = 0, f[11][101], C[101][101];
long long dp(int x) {
  memset(f, 0, sizeof(f));
  f[0][0] = 1;
  for (int i = 0; i < 10; i++)
    for (int j = 0; j <= x; j++)
      if (!f[i][j])
        continue;
      else
        for (int k = a[i + 1]; k + j <= x; k++)
          f[i + 1][j + k] = (f[i + 1][j + k] + f[i][j] * C[j + k][k]) % BASE;
  return f[10][x];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= 10; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  C[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    C[i][0] = 1;
    for (int j = 1; j <= i; j++)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % BASE;
  }
  for (int bit = max(1, sum); bit <= n; bit++) {
    if (bit == 1)
      ans += sum == 1 ? 1 : 9;
    else {
      for (int i = 2; i <= 10; i++) {
        int tmp = (a[i] != 0);
        a[i] -= tmp;
        ans = (ans + dp(bit - 1)) % BASE;
        a[i] += tmp;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
