#include <bits/stdc++.h>
using namespace std;
const int N = 2e6;
const long long mod = 1e9 + 7;
const long long inf = 1e15;
long long a[10], n, F[200][10], c[200][200];
long long f(long long n, long long k) {
  if (F[n][k] != -1) return F[n][k];
  if (k == 9) return F[n][k] = n >= a[9];
  if (k) {
    long long ans = 0;
    for (long long i = a[k]; i <= n; i++) {
      ans += f(n - i, k + 1) * c[n][i] % mod;
      ans %= mod;
    }
    return F[n][k] = ans;
  }
  long long ans = 0;
  for (long long i = a[k]; i < n; i++) {
    ans += f(n - i, k + 1) * c[n - 1][i] % mod;
    ans %= mod;
  }
  return F[n][k] = ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cerr.tie(nullptr);
  c[0][0] = 1;
  for (int n = 1; n <= 105; n++) {
    for (int r = 0; r <= n; r++) {
      if (r) c[n][r] += c[n - 1][r - 1];
      if (r <= n - 1) c[n][r] += c[n - 1][r];
      c[n][r] %= mod;
    }
  }
  memset(F, -1, sizeof(F));
  cin >> n;
  for (int i = 0; i <= 9; i++) cin >> a[i];
  long long ans = 0;
  for (int l = 1; l <= n; l++) {
    ans += f(l, 0);
    ans %= mod;
  }
  cout << ans;
}
