#include <bits/stdc++.h>
using namespace std;
int a[10];
long long c[250][250], dp[10][250];
void Init() {
  for (int i = 0; i < 250; i++) c[i][0] = c[i][i] = 1;
  for (int i = 2; i < 250; i++) {
    for (int j = 1; j < i; j++)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % 1000000007;
  }
}
int main() {
  int n;
  Init();
  while (cin >> n) {
    memset(dp, 0, sizeof(dp));
    for (int i = 0; i <= 9; i++) cin >> a[i];
    for (int i = 0; i <= n; i++) {
      if (i >= a[9])
        dp[9][i] = 1;
      else
        dp[9][i] = 0;
    }
    for (int i = 8; i >= 0; i--) {
      for (int j = n; j >= 0; j--) {
        for (int k = j - a[i]; k >= 0; k--) {
          if (i != 0)
            dp[i][j] = (dp[i][j] + dp[i + 1][k] * c[j][k]) % 1000000007;
          else if (j && k)
            dp[i][j] = (dp[i][j] + dp[i + 1][k] * c[j - 1][k - 1]) % 1000000007;
        }
      }
    }
    long long ret = 0;
    for (int i = 0; i <= n; i++) ret = (ret + dp[0][i]) % 1000000007;
    cout << ret << endl;
  }
  return 0;
}
