#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;
const long long MOD = 1e9 + 696969;
const long long INF = 1e18;
const int N = 125;
long long dp[150][150], wyn[150], newdp[150], pref[150];
int n, m, k, a, b, c, T;
int lit[30], l2[30], ile[30];
int main() {
  for (int i = (0); i <= (N); ++i) dp[1][i] = 1;
  dp[0][0] = 1;
  for (int i = (1); i <= (N); ++i) {
    dp[i][0] = 1;
    pref[0] = 1;
    for (int j = (1); j <= (N); ++j) {
      pref[j] = (pref[j - 1] + dp[i - 1][j]);
      while (pref[j] >= mod) pref[j] -= mod;
    }
    for (int j = (1); j <= (N); ++j) dp[i][j] = pref[j];
  }
  cin >> n;
  int suma = 0;
  for (int i = (0); i <= (9); ++i) {
    cin >> ile[i];
    suma += ile[i];
  }
  if (suma > n) {
    cout << 0;
    exit(0);
  };
  for (int i = (ile[1]); i <= (n); ++i) wyn[i] = 1;
  for (int i = (2); i <= (9); ++i) {
    for (int j = (0); j <= (n); ++j) newdp[j] = 0;
    for (int j = (0); j <= (n); ++j)
      for (int kk = (0); kk <= (j); ++kk) {
        int diff = j - kk;
        if (diff >= ile[i])
          newdp[j] = (newdp[j] + dp[kk + 1][diff] * wyn[kk]) % mod;
      }
    for (int j = (0); j <= (n); ++j) wyn[j] = newdp[j];
  }
  for (int j = (0); j <= (n); ++j) newdp[j] = 0;
  for (int j = (0); j <= (n); ++j)
    for (int kk = (0); kk <= (j); ++kk) {
      int diff = j - kk;
      if (diff >= ile[0]) newdp[j] = (newdp[j] + dp[kk][diff] * wyn[kk]) % mod;
    }
  long long ww = 0;
  for (int i = (suma); i <= (n); ++i) ww = (ww + newdp[i]) % mod;
  if (suma == 0)
    cout << (ww - 1 + mod) % mod;
  else
    cout << ww;
}
