#include <bits/stdc++.h>
using namespace std;
long long int dp[11][101];
long long int fact[101];
int a[101];
long long int modexp(long long int a, long long int b, long long int c) {
  long long int cur = 1;
  while (b) {
    if ((b & 1)) {
      cur *= a;
      cur %= c;
    }
    b >>= 1;
    a *= a;
    a %= c;
  }
  return cur;
}
int dfs(int curdig, int remdig) {
  if (remdig < 0) return 0;
  if (curdig == 10 && remdig == 0) return 1;
  if (curdig == 10) return 0;
  if (dp[curdig][remdig] != -1) return dp[curdig][remdig];
  long long int ret = 0;
  int i;
  for (i = a[curdig]; i <= 100; i++) {
    ret += (dfs(curdig + 1, remdig - i) * fact[i]) % 1000000007;
    ret %= 1000000007;
  }
  return dp[curdig][remdig] = ret;
}
long long int dp2[101][101];
int getways(int n, int s) {
  if (s == 0) return 1;
  if (n == 0) return 0;
  if (dp2[n][s] != -1) return dp2[n][s];
  long long int ret = 0;
  int i;
  for (i = 0; i <= s; i++) {
    ret += getways(n - 1, s - i);
    ret %= 1000000007;
  }
  return dp2[n][s] = ret;
}
int main() {
  int n, i, j;
  fact[0] = 1;
  long long int fact2[1001];
  for (i = 1; i <= 100; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= 1000000007;
    fact2[i] = fact[i];
  }
  for (i = 0; i <= 100; i++) {
    fact[i] = modexp(fact[i], 1000000007 - 2, 1000000007);
  }
  cin >> n;
  memset(dp2, -1, sizeof(dp2));
  for (i = 0; i < 10; i++) cin >> a[i];
  long long int ans = 0, cans;
  for (i = 1; i <= n; i++) {
    memset(dp, -1, sizeof(dp));
    cans = (dfs(1, i) * fact2[i]) % 1000000007;
    for (j = a[0] + i; j <= n; j++) {
      ans += (cans * getways(i, j - i)) % 1000000007;
      ans %= 1000000007;
    }
  }
  cout << ans << endl;
}
