#include <bits/stdc++.h>
using namespace std;
long long NcR[110][110];
long long ncr(int n, int r) {
  if (r > n) return 0;
  if (n == r) return 1;
  if (r == 0) return 1;
  assert(n >= 0 and r >= 0);
  if (NcR[n][r] != -1) return NcR[n][r];
  NcR[n][r] = ncr(n - 1, r) + ncr(n - 1, r - 1);
  NcR[n][r] %= 1000000007;
  return NcR[n][r];
}
int a[20];
long long dp[101][101];
long long solve(int pos, int n) {
  if (n < 0) return 0;
  if (pos == 10) return (n == 0);
  assert(pos >= 0 and n >= 0);
  if (dp[pos][n] != -1) return dp[pos][n];
  dp[pos][n] = 0;
  for (int i = a[pos]; i <= n; i++) {
    dp[pos][n] += ncr((pos == 0 and i) ? n - 1 : n, i) * solve(pos + 1, n - i);
    dp[pos][n] %= 1000000007;
  }
  return dp[pos][n];
}
int n;
int main() {
  memset(NcR, -1, sizeof(NcR));
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> a[i];
  memset(dp, -1, sizeof(dp));
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    memset(dp, -1, sizeof(dp));
    ans += solve(0, i);
  }
  cout << ans % 1000000007 << endl;
  return 0;
}
