#include <bits/stdc++.h>
using namespace std;
int n, A[11];
long long dp[102][12][102], fact[105], inv[105];
long long mod = 1000000007;
long long po(long long p, long long q) {
  if (q == 0) return 1;
  if (q == 1) return p;
  long long ret = po(p, q / 2);
  ret = (ret * ret) % mod;
  if (q & 1) ret = ret * p % mod;
  return ret;
}
long long dfs(int now, int num, int cnt) {
  long long& ret = dp[now][num][cnt];
  if (ret != -1) return ret;
  ret = 0;
  if (num == 10) {
    return ret = fact[now - 2];
  }
  if (now <= n) ret = (ret + dfs(now + 1, num, cnt + 1)) % mod;
  if (num <= 9 && A[num] <= cnt) {
    ret = (ret + dfs(now, num + 1, 0) * inv[cnt] % mod) % mod;
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  int ss = 0;
  for (int i = 0; i < 10; i++) {
    scanf("%d", &A[i]);
    ss += A[i];
  }
  if (ss > n) {
    puts("0");
    return 0;
  }
  if (A[0] > 1 && A[0] >= n) {
    puts("0");
    return 0;
  }
  if (A[0] == 1 && n == 1 && ss == 1) {
    puts("1");
    return 0;
  }
  fact[0] = 1;
  inv[0] = po(fact[0], mod - 2);
  for (int i = 1; i <= n; i++) {
    fact[i] = fact[i - 1] * (long long)i % mod;
    inv[i] = po(fact[i], mod - 2);
  }
  long long ans = 0;
  for (int st = 1; st <= 9; st++) {
    --A[st];
    memset(dp, -1, sizeof(dp));
    ans = (ans + dfs(2, 0, 0)) % mod;
    ++A[st];
  }
  cout << ans;
}
