#include <bits/stdc++.h>
using namespace std;
inline long long tavan(long long a, long long n, long long mod) {
  long long p = 1;
  while (n > 0) {
    if (n % 2) {
      p = p * a;
      p %= mod;
    }
    n >>= 1;
    a *= a;
    a %= mod;
  }
  return p % mod;
}
long long n, a[10], dp[2][(101)][10], c[(101)][(101)], ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < (101); i++) c[i][i] = c[i][0] = 1;
  for (int i = 1; i < (101); i++)
    for (int j = 1; j < i; j++)
      c[i][j] = c[i - 1][j] + c[i - 1][j - 1], c[i][j] %= ((long long)1e9 + 7);
  for (int i = 0; i < 10; i++) cin >> a[i], dp[0][0][i] = 1;
  for (int i = 1; i <= n; i++) {
    if (i >= a[0]) dp[0][i][0] = 1;
    for (int j = 1, sum = a[0]; j < 10; sum += a[j], j++)
      for (int k = a[j]; k <= i - sum; k++) {
        dp[0][i][j] += dp[0][i - k][j - 1] * c[i][k],
            dp[0][i][j] %= ((long long)1e9 + 7);
        if (k)
          dp[1][i][j] += dp[0][i - k][j - 1] * c[i - 1][k - 1],
              dp[1][i][j] %= ((long long)1e9 + 7);
        dp[1][i][j] += dp[1][i - k][j - 1] * c[i - 1][k],
            dp[1][i][j] %= ((long long)1e9 + 7);
      }
    ans += dp[1][i][9], ans %= ((long long)1e9 + 7);
  }
  cout << ans;
  return 0;
}
