#include <bits/stdc++.h>
using namespace std;
const int M = 105;
long long C[M][M];
const long long mod = 1000000007;
int a[10];
long long memo[105][10];
long long f(int n, int dig) {
  if (n < 0) return 0;
  if (n == 0) {
    if (dig == 10) return 1;
    if (a[dig] == 0)
      return f(n, dig + 1);
    else
      return 0;
  }
  if (n >= 0 and dig == 9) return (a[dig] <= n);
  long long &ans = memo[n][dig];
  if (ans >= 0) return ans;
  ans = 0;
  for (int i = a[dig]; i <= n; ++i)
    ans = (ans + (C[n][i] * f(n - i, dig + 1)) % mod) % mod;
  return ans;
}
int main() {
  memset(C, 0, sizeof(C));
  C[0][0] = 1;
  for (int i = 1; i < M; ++i) {
    C[i][0] = 1;
    for (int j = 1; j <= i; ++j)
      C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 0; i < 10; ++i) {
    cin >> a[i];
    sum += a[i];
  }
  long long ans = 0;
  for (int len = 1; len <= n; ++len) {
    for (int d = 1; d <= 9; ++d) {
      int old = a[d];
      if (a[d] > 0) --a[d];
      memset(memo, -1, sizeof(memo));
      long long r = f(len - 1, 0);
      ans = (ans + r) % mod;
      a[d] = old;
    }
  }
  cout << ans << endl;
}
