#include <bits/stdc++.h>
using namespace std;
const long long M = 5205;
const long long INF = 1e15 + 5;
const long long MOD = 1e9 + 7;
const long long N = 2e5;
const double PI = 3.14159265358979323846264338327950288419716939937510;
long long n, a[11], ans, t, dp[105][15], fact[105];
int c[105][105];
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long i) { return power(i, MOD - 2, MOD); }
long long C(long long af, long long b) {
  if (af < b) return 0;
  if (b == 0) return 1;
  return (fact[af] * modInverse(fact[b]) % MOD * modInverse(fact[af - b]) %
          MOD) %
         MOD;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  fact[0] = 1;
  for (long long i = 1; i <= n; i++) fact[i] = (fact[i - 1] * i) % MOD;
  c[0][0] = 1;
  for (int i = 0; i <= 100; i++)
    for (int j = 0; j <= i; j++)
      if (j == 0)
        c[i][j] = 1;
      else
        c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % MOD;
  for (long long i = 0; i <= 9; i++) {
    cin >> a[i];
  }
  for (long long i = 0; i <= n; i++) {
    for (long long j = 9; j >= 0; j--) {
      if (j == 9) {
        if (i < a[j])
          dp[i][j] = 0;
        else
          dp[i][j] = 1;
      } else if (j == 0) {
        for (long long k = a[j]; k <= i; k++)
          dp[i][j] = (dp[i][j] + dp[i - k][j + 1] * c[i - 1][k]) % MOD;
      } else {
        for (long long k = a[j]; k <= i; k++)
          dp[i][j] = (dp[i][j] + dp[i - k][j + 1] * c[i][k]) % MOD;
      }
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++) ans = (ans + dp[i][0]) % MOD;
  cout << ans << "\n";
}
