#include <bits/stdc++.h>
using namespace std;
long long Bigmod(long long base, long long power, long long MOD) {
  long long ret = 1;
  while (power) {
    if (power & 1) ret = (ret * base) % MOD;
    base = (base * base) % MOD;
    power >>= 1;
  }
  return ret;
}
long long ModInverse(long long number, long long MOD) {
  return Bigmod(number, MOD - 2, MOD);
}
int a[102];
long long F[102];
long long FF[102];
long long dp[12][102];
int N;
long long Solve(int p, int ln) {
  if (p == 10) {
    if (ln) return 0;
    return F[N - 1];
  }
  long long &res = dp[p][ln];
  if (res != -1) return res;
  res = 0;
  int mst = a[p];
  for (int i = 0; i <= 100; i++) {
    int tp = mst + i;
    if (tp > ln) break;
    long long nw = Solve(p + 1, ln - tp);
    nw = (nw * FF[tp]) % 1000000007;
    res = (res + nw) % 1000000007;
  }
  return res;
}
long long Dekhi(int M) {
  long long ans = 0;
  N = M;
  for (int i = 1; i < 10; i++) {
    int tp = a[i];
    a[i] = max(0, a[i] - 1);
    memset(dp, -1, sizeof(dp));
    ans = (ans + Solve(0, M - 1)) % 1000000007;
    a[i] = tp;
  }
  return ans;
}
int main() {
  int n;
  F[0] = 1;
  FF[0] = ModInverse(F[0], 1000000007);
  for (int i = 1; i < 101; i++) {
    F[i] = (F[i - 1] * i) % 1000000007;
    FF[i] = ModInverse(F[i], 1000000007);
  }
  scanf("%d", &n);
  for (int i = 0; i < 10; i++) {
    scanf("%d", &a[i]);
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    ans = (ans + Dekhi(i)) % 1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
