#include <bits/stdc++.h>
using namespace std;
long long dp[105][15];
long long ncr[105][105];
int val[15];
long long nCr(int n, int r) {
  if (r == 0) return 1;
  if (r == 1) return n;
  if (r > n) return 0;
  long long &ret = ncr[n][r];
  if (ret != -1) return ret;
  ret = nCr(n - 1, r) + nCr(n - 1, r - 1);
  ret %= 1000000007;
  return ret;
}
long long rec(int rem, int pos) {
  if (pos == 10) {
    return rem == 0;
  }
  long long &ret = dp[rem][pos];
  if (ret != -1) return ret;
  ret = 0;
  for (int i = val[pos]; i <= rem; i++) {
    ret = (ret + (nCr(rem, i) * rec(rem - i, pos + 1))) % 1000000007;
  }
  return ret;
}
int main() {
  int n, i;
  scanf("%d", &n);
  int tot = 0;
  for (i = 0; i <= 9; i++) {
    scanf("%d", &val[i]);
    tot += val[i];
  }
  if (tot > n) {
    printf("0\n");
    return 0;
  }
  memset(ncr, -1, sizeof ncr);
  long long ans = 0, f;
  for (int j = 1; j <= n; j++) {
    for (i = 1; i <= 9; i++) {
      f = 0;
      if (val[i] > 0) {
        val[i]--;
        f = 1;
      }
      memset(dp, -1, sizeof dp);
      ans = (ans + rec(j - 1, 0)) % 1000000007;
      if (f) val[i]++;
    }
  }
  printf("%lld\n", ans);
}
