#include <bits/stdc++.h>
using namespace std;
int n;
int a[10];
long long c[2000][2000];
long long d[2000][2000];
inline long long go(int pos, int len) {
  if (pos == 10) return len == 0;
  if (d[pos][len] != -1) return d[pos][len];
  long long r = 0;
  for (int i = a[pos]; i <= len; ++i)
    r = (r + go(pos + 1, len - i) * (pos == 0 ? c[len - 1][i] : c[len][i])) %
        1000000007;
  return d[pos][len] = r;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < 10; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < 2000; ++i) {
    c[i][0] = c[i][i] = 1;
    for (int j = 1; j < i; ++j)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 1000000007;
  }
  memset(d, -1, sizeof(d));
  long long ans = 0;
  for (int i = 1; i <= n; ++i) ans = (ans + go(0, i)) % 1000000007;
  printf("%I64d\n", ans);
  return 0;
}
