#include <bits/stdc++.h>
using namespace std;
int recur_depth = 0;
const long long mod = 1e9 + 7, sz = 110;
long long n, a[10], dp[sz][10], ncr[sz][sz];
long long solve(long long len, long long d) {
  if (d == 10) return len == 0;
  long long& ret = dp[len][d];
  if (ret != -1) return ret;
  ret = 0;
  long long lim = len;
  if (d == 0) lim = len - 1;
  for (long long i = a[d]; i <= lim; i++) {
    if (d == 0)
      ret = (ret + ncr[len - 1][i] * solve(len - i, d + 1)) % mod;
    else
      ret = (ret + ncr[len][i] * solve(len - i, d + 1)) % mod;
  }
  return ret;
}
int main() {
  ncr[0][0] = 1;
  for (long long i = 1; i <= sz - 1; ++i) {
    ncr[i][0] = ncr[i][i] = 1;
    for (long long j = 1; j <= i - 1; ++j) {
      ncr[i][j] = (ncr[i - 1][j - 1] + ncr[i - 1][j]);
      if (ncr[i][j] >= mod) ncr[i][j] -= mod;
    }
  }
  cin >> n;
  for (long long i = 0; i < 10; ++i) cin >> a[i];
  memset(dp, -1, sizeof(dp));
  long long ans = 0;
  for (long long i = 1; i <= n; ++i) {
    ans += solve(i, 0);
    if (ans >= mod) ans -= mod;
  }
  cout << ans << '\n';
  return 0;
}
