#include <bits/stdc++.h>
using namespace std;
int n, a[10], f[105][10], c[105][105];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < (10); i++) scanf("%d", &a[i]);
  c[0][0] = 1;
  c[0][1] = 0;
  for (int i = (1); i < (n + 1); i++) {
    c[i][0] = 1;
    for (int j = (1); j < (i + 1); j++)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 1000000007;
  }
  memset((f), (0), sizeof((f)));
  for (int i = (a[9]); i < (n + 1); i++) f[i][9] = 1;
  for (int i = (9) - 1; i > -1; i--) {
    for (int l = 0; l < (n + 1); l++)
      for (int k = (a[i]); k < (l + 1); k++)
        f[l][i] = (f[l][i] + f[l - k][i + 1] * 1ll * c[i ? l : l - 1][k]) %
                  1000000007;
  }
  int res = 0;
  for (int i = (1); i < (n + 1); i++) res = (res + f[i][0]) % 1000000007;
  printf("%d\n", res);
}
