#include <bits/stdc++.h>
using namespace std;
int N, ar[10];
int mod = 1000000007;
int mem1[101][101], mem2[10][101];
int ncr(int n, int r) {
  if (r == 0) return 1;
  if (n == 0) return 0;
  if (mem1[n][r] > -1) return mem1[n][r];
  return mem1[n][r] = (ncr(n - 1, r - 1) + ncr(n - 1, r)) % mod;
}
int f(int ind, int len) {
  if (ind >= 10 && len == 0) return 1;
  if (ind >= 10) return 0;
  if (len == 0) {
    if (ar[ind] > 0) return 0;
    return f(ind + 1, len);
  }
  if (mem2[ind][len] > -1) return mem2[ind][len];
  int tot = 0;
  int upto = len;
  if (ind == 0) upto--;
  for (int i = ar[ind]; i <= len; i++) {
    long long x = ncr(upto, i);
    long long y = f(ind + 1, len - i);
    long long z = mod, cur = x * y;
    cur %= z;
    tot = (tot + (int)cur) % mod;
  }
  return mem2[ind][len] = tot;
}
int main() {
  memset(mem1, -1, sizeof(mem1));
  memset(mem2, -1, sizeof(mem2));
  cin >> N;
  for (int i = 0; i < 10; i++) cin >> ar[i];
  int tot = 0;
  for (int i = 1; i <= N; i++) tot = (tot + f(0, i)) % mod;
  cout << tot << endl;
  return 0;
}
