#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1e9 + 7;
const long long N = 10;
long long FastPower(long long x, long long y);
long long Rec(long long i, long long k);
long long C(long long NN, long long R);
long long a[15];
long long Fact[110];
long long Dp[15][110];
int main() {
  Fact[0] = 1;
  for (long long i = 1; i < 110; i++) Fact[i] = (i * Fact[i - 1]) % Mod;
  long long n;
  cin >> n;
  for (long long i = 0; i < N; i++) scanf("%I64d", &a[i]);
  long long Answer = 0;
  memset(Dp, -1, sizeof(Dp));
  for (long long i = 1; i <= n; i++) Answer = (Answer + Rec(0, i)) % Mod;
  a[0] = max(a[0] - 1, 0LL);
  memset(Dp, -1, sizeof(Dp));
  for (long long i = 1; i <= n; i++)
    Answer = (Answer - Rec(0, i - 1) + Mod) % Mod;
  cout << Answer;
}
long long Rec(long long i, long long k) {
  if (i == N) return (k == 0);
  if (Dp[i][k] != -1) return Dp[i][k];
  long long Res = 0;
  for (long long j = a[i]; j <= k; j++)
    Res = (Res + (C(k, j) * Rec(i + 1, k - j)) % Mod) % Mod;
  return Dp[i][k] = Res;
}
long long FastPower(long long x, long long y) {
  if (!y) return 1;
  long long Res = FastPower(x, y >> 1);
  Res = (Res * Res) % Mod;
  if (y & 1) Res = (Res * x) % Mod;
  return Res;
}
long long C(long long NN, long long R) {
  if (R > NN) return 0;
  return (Fact[NN] * FastPower((Fact[R] * Fact[NN - R]) % Mod, Mod - 2)) % Mod;
}
