#include <bits/stdc++.h>
using namespace std;
long long n;
long long a[15];
long long tt[110][110];
long long dp[15][110];
const int mod = 1e9 + 7;
void cal() {
  for (int i = 0; i <= n; ++i) {
    for (int j = 0; j <= i; ++j) {
      if (j == 0 || i == j)
        tt[i][j] = 1;
      else
        tt[i][j] = (tt[i - 1][j - 1] + tt[i - 1][j]) % mod;
    }
  }
}
void dx() {
  cal();
  int ans = 0;
  for (int i = a[9]; i <= n; ++i) dp[9][i] = 1;
  for (int i = 8; i >= 0; --i) {
    for (int j = a[i]; j <= n; ++j)
      for (int x = a[i]; x <= j; ++x)
        dp[i][j] = (dp[i][j] + dp[i + 1][j - x] * tt[j - (i == 0)][x]) % mod;
  }
  for (int i = 1; i <= n; ++i) ans = (ans + dp[0][i]) % mod;
  cout << ans;
}
int main() {
  cin >> n;
  for (int i = 0; i <= 9; ++i) cin >> a[i];
  dx();
}
