#include <bits/stdc++.h>
using namespace std;
long long mem[10][101], c[101][101], a[15];
long long nCr(long long n, long long r) {
  if (n == r || r == 0)
    return 1;
  else if (c[n][r] != -1)
    return c[n][r];
  return c[n][r] = (nCr(n - 1, r - 1) + nCr(n - 1, r)) % 1000000007;
}
long long dp(long long cur, long long n) {
  if (cur == 9) return a[cur] <= n;
  long long &ret = mem[cur][n], m = cur ? n : n - 1;
  if (ret != -1) return ret;
  ret = 0;
  for (long long i = a[cur]; i <= m; i++)
    ret = (ret + (nCr(m, i) * dp(cur + 1, n - i)) % 1000000007) % 1000000007;
  return ret;
}
int main() {
  memset(c, -1, sizeof(c));
  long long n, total = 0, ans = 0;
  scanf("%lld", &n);
  for (long long i = 0; i < 10; i++) scanf("%lld", a + i), total += a[i];
  for (long long i = total; i <= n; i++) {
    memset(mem, -1, sizeof(mem));
    ans = (ans + dp(0, i)) % 1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
