#include <bits/stdc++.h>
using namespace std;
const long long int MOD = 1e9 + 7;
long long int power(long long int x, long long int y) {
  long long int ans = 1;
  x = x % MOD;
  while (y > 0) {
    if (y & 1) {
      ans *= x;
      ans %= MOD;
    }
    y = y >> 1;
    x = (x * x) % MOD;
  }
  return ans;
}
vector<long long int> fac(102, 0);
long long int inverseMod(long long int a) { return power(a, MOD - 2); }
long long int nCr(long long int n, long long int r) {
  if (r > n) {
    return 0;
  }
  long long int ans = fac[n];
  long long int val = (inverseMod(fac[r]) * inverseMod(fac[n - r])) % MOD;
  ans *= val;
  ans %= MOD;
  return ans;
}
vector<vector<long long int>> dp(102, vector<long long int>(10, 0));
void solve() {
  fac[0] = 1;
  for (long long int i = 1; i < 102; i++) {
    fac[i] = (fac[i - 1] * i) % MOD;
  }
  long long int n, a;
  cin >> n;
  vector<long long int> v;
  long long int sum = 0;
  for (long long int i = 0; i < 10; i++) {
    cin >> a;
    v.push_back(a);
    sum += a;
  }
  if (sum > n) {
    cout << "0" << endl;
    return;
  }
  long long int ans = 0;
  for (long long int cnt = v[1]; cnt <= n; cnt++) {
    dp[cnt][1] = 1;
  }
  for (long long int digit = 2; digit <= 9; digit++) {
    for (long long int len = 0; len <= n; len++) {
      for (long long int cnt = v[digit]; cnt <= len; cnt++) {
        dp[len][digit] += (nCr(len, cnt) * dp[len - cnt][digit - 1]) % MOD;
        dp[len][digit] %= MOD;
      }
    }
  }
  for (long long int len = sum; len <= n; len++) {
    for (long long int i = v[0]; i <= len; i++) {
      ans += (nCr(len - 1, i) * dp[len - i][9]) % MOD;
      ans %= MOD;
    }
  }
  cout << ans << endl;
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  solve();
  return 0;
}
