#include <bits/stdc++.h>
using namespace std;
vector<long long> digit(10);
long long memo[101][10];
vector<long long> fact, invfact;
long long c[107][107];
long long bigmod(long long n, long long p, long long m) {
  if (p == 0) return 1;
  long long x = bigmod(n, p >> 1, m);
  x = (x * x) % m;
  if (p & 1) x = (x * n) % m;
  return x;
}
long long ncr(long long n, long long r) {
  if (n < r) return 0;
  return (((fact[n] * invfact[r]) % 1000000007 * invfact[n - r]) % 1000000007 +
          1000000007) %
         1000000007;
}
long long dp(long long len, long long dig) {
  if (dig == 9) return (len >= digit[dig]);
  long long &ans = memo[len][dig];
  if (ans != -1) return ans;
  ans = 0;
  if (dig == 0) {
    for (int i = digit[dig]; i <= len; ++i) {
      ans += (dp(len - i, dig + 1) % 1000000007 * ncr(len - 1, i)) % 1000000007;
      ans %= 1000000007;
    }
  } else {
    for (int i = digit[dig]; i <= len; ++i) {
      ans += (dp(len - i, dig + 1) % 1000000007 * ncr(len, i)) % 1000000007;
      ans %= 1000000007;
    }
  }
  return ans;
}
int main() {
  fact.emplace_back(1);
  invfact.emplace_back(1);
  fact.emplace_back(1);
  invfact.emplace_back(1);
  for (long long i = 2; i <= 107; ++i) {
    fact.emplace_back(((fact.back() % 1000000007) * i) % 1000000007);
    invfact.emplace_back(((invfact.back() % 1000000007) *
                          (bigmod(i, 1000000007 - 2, 1000000007)) %
                          1000000007) %
                         1000000007);
  }
  long long m;
  cin >> m;
  for (auto &i : digit) cin >> i;
  long long ans = 0;
  memset(memo, -1, sizeof(memo));
  for (int i = 1; i <= m; ++i) {
    ans += dp(i, 0);
    if (ans > 1000000007) ans -= 1000000007;
  }
  cout << ans << "\n";
  return 0;
}
