#include <bits/stdc++.h>
using namespace std;
long long a[10], cm[11], dp[101][10], fact[101];
long long n, k;
long long power(long long i, long long d) {
  if (d == 0) return 1;
  long long ans = 1, y = i % 1000000007LL;
  while (d) {
    if (d & 1) ans = (ans * y) % 1000000007LL;
    y = (y * y) % 1000000007LL;
    d /= 2;
  }
  return ans;
}
long long inv_mod(long long a) { return power(a, 1000000007LL - 2); }
void precompute() {
  fact[0] = 1;
  for (long long i = 1; i <= 100; i++)
    fact[i] = (i * fact[i - 1]) % 1000000007LL;
  memset(dp, -1, sizeof(dp));
  cm[10] = 0;
  for (long long i = 9; i >= 0; i--) cm[i] = cm[i + 1] + a[i];
}
long long nCr(long long n, long long r) {
  long long result = fact[n];
  result = (result * inv_mod(fact[r])) % 1000000007LL;
  result = (result * inv_mod(fact[n - r])) % 1000000007LL;
  return result;
}
long long update(long long len, long long ind) {
  if (ind == 9) return 1;
  if (dp[len][ind] != -1) return dp[len][ind];
  long long result = 0;
  long long dep = 0;
  if (ind == 0) dep = 1;
  for (long long l = a[ind]; l <= len - cm[ind + 1]; l++) {
    result = (result +
              (nCr(len - dep, l) * update(len - l, ind + 1)) % 1000000007LL) %
             1000000007LL;
  }
  return dp[len][ind] = result;
}
int main() {
  cin >> n;
  for (long long i = 0; i < 10; i++) cin >> a[i];
  precompute();
  long long result = 0;
  for (long long i = 1; i <= n; i++)
    result = (result + update(i, 0)) % 1000000007LL;
  cout << result << endl;
  return 0;
}
