#include <bits/stdc++.h>
using namespace std;
long long b[101][101], c[101];
int a[10];
const long long delta = 1e9 + 7;
long long f(int n, int i) {
  long long d[101];
  for (int j = 0; j <= 100; j++) d[j] = 0;
  for (int k = 0; k <= n; k++) {
    for (int j = a[i]; j <= n; j++) {
      if (k + j <= n) {
        d[k + j] += c[k] * b[k + j][j];
        d[k + j] %= delta;
      }
    }
  }
  for (int j = 0; j <= 100; j++) c[j] = d[j];
  if (i != 9)
    return f(n, i + 1);
  else {
    long long sum = 0;
    for (int i = 1; i <= 100; i++) {
      sum += c[i];
      sum %= delta;
    }
    return sum;
  }
}
int main() {
  for (int i = 0; i <= 100; i++) c[i] = 0;
  for (int i = 0; i <= 100; i++) {
    for (int j = 0; j <= 100; j++) {
      if (j == 0 || j == i)
        b[i][j] = 1;
      else
        b[i][j] = 0;
    }
  }
  for (int i = 1; i <= 100; i++) {
    for (int j = 1; j < i; j++) {
      b[i][j] = b[i - 1][j - 1] + b[i - 1][j];
      b[i][j] %= delta;
    }
  }
  int n;
  cin >> n;
  int y = 0;
  for (int i = 0; i < 10; i++) {
    cin >> a[i];
    y += a[i];
  }
  c[0] = 1;
  long long u = f(n, 0);
  n--;
  a[0]--;
  a[0] = max(a[0], 0);
  for (int i = 0; i <= 100; i++) c[i] = 0;
  c[0] = 1;
  long long u1 = f(n, 0);
  u -= u1;
  u += delta;
  u %= delta;
  if (y == 0) {
    u--;
    u += delta;
    u %= delta;
  }
  cout << u;
}
