#include <bits/stdc++.h>
using namespace std;
const long long M = 1000 * 1000 * 1000 + 7;
long long fac[101];
long long inv(long long x) {
  long long r, y;
  for (r = 1, y = M - 2; y; x = x * x % M, y >>= 1) (y & 1) && (r = r * x % M);
  return r;
}
int C(int n, int m) { return fac[n] * inv(fac[m]) % M * inv(fac[n - m]) % M; }
int a[10];
int n;
long long dp[10][101];
long long solve(int i, int j) {
  if (j < 0) return 0;
  if (i == 10) return (j == 0);
  long long &res = dp[i][j];
  if (res != -1) return res;
  res = 0;
  for (int k = a[i]; k <= j; k++) {
    res += (C((i == 0 ? j - 1 : j), k) * solve(i + 1, j - k)) % M;
    if (res >= M) res -= M;
  }
  return res;
}
int main() {
  std::ios_base::sync_with_stdio(false);
  fac[0] = 1;
  for (long long i = 1; i <= 100; i++) fac[i] = (i * fac[i - 1]) % M;
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> a[i];
  long long ans = 0;
  memset(dp, -1, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    ans += solve(0, i);
    if (ans >= M) ans -= M;
  }
  cout << ans;
}
