#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int maxN = 110;
int a[maxN];
long long c[maxN][maxN], dp[maxN][maxN], ans;
void fillC() {
  for (int i = 0; i < maxN; i++) c[i][i] = c[0][i] = 1;
  for (int i = 1; i < maxN; i++)
    for (int j = 1; j < maxN; j++)
      c[i][j] = (c[i - 1][j - 1] + c[i][j - 1]) % MOD;
}
int main() {
  int n;
  fillC();
  cin >> n;
  for (int i = 0; i < 10; i++) cin >> a[i];
  for (int i = a[9]; i <= n; i++) dp[i][9] = 1;
  for (int i = 0; i <= n; i++)
    for (int j = 8; j > 0; j--) {
      long long now = 0;
      for (int k = a[j]; k <= i; k++)
        now = (now + dp[i - k][j + 1] * c[k][i]) % MOD;
      dp[i][j] = now;
    }
  for (int i = 0; i <= n; i++) {
    for (int j = a[0]; j <= i; j++)
      dp[i][0] += (dp[i - j][1] * c[j][i - 1]) % MOD;
    ans = ans + dp[i][0];
    ans %= MOD;
  }
  cout << ans << endl;
  cin >> n;
}
