#include <bits/stdc++.h>
const long long mod = 1000000007;
int n;
int comb[101][101];
long long getCount(int arr[], int len) {
  long long d[101][10] = {0};
  for (int i = arr[9]; i <= len; ++i) d[i][9] = 1;
  for (int i = 0; i <= len; ++i) {
    for (int j = 8; j >= 1; --j) {
      for (int k = arr[j]; k <= i; ++k) {
        d[i][j] = (d[i][j] + d[i - k][j + 1] * comb[i][k]) % mod;
      }
    }
  }
  long long ret = 0;
  for (int i = 1; i <= len; ++i) {
    for (int j = arr[0]; j < i; ++j) {
      ret = (ret + d[i - j][1] * comb[i - 1][j]) % mod;
    }
  }
  return ret;
}
int main() {
  int a[10] = {0};
  scanf("%d", &n);
  for (int i = 0; i < 10; ++i) {
    scanf("%d", &a[i]);
  }
  for (int i = 0; i <= n; ++i) {
    comb[i][0] = 1;
    for (int j = 1; j <= i; ++j) {
      comb[i][j] = (comb[i - 1][j] + comb[i - 1][j - 1]) % mod;
    }
  }
  printf("%d\n", (int)getCount(a, n));
  return 0;
}
