#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
const long long int inf = 1e18;
const double EPS = 1E-9;
long long int n, cnt = 0, ans = 0, temp = 0;
vector<long long int> arr(10);
vector<vector<long long int>> dp1(101, vector<long long int>(101, 0));
long long int dp[101][10];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  dp1[0][0] = 1;
  dp1[1][0] = dp1[1][1] = 1;
  for (long long int i = 2; i < 101; i++) {
    dp1[i][0] = dp1[i][i] = 1;
    for (long long int j = 1; j < i; j++) {
      dp1[i][j] = (dp1[i - 1][j] + dp1[i - 1][j - 1]) % mod;
    }
  }
  cin >> n;
  for (long long int i = 0; i < 10; i++) {
    cin >> arr[i];
    cnt += arr[i];
  }
  if (cnt > n) {
    cout << 0 << endl;
    return 0;
  }
  for (long long int i = 0; i < n + 1; i++) {
    if (i >= arr[9]) {
      dp[i][9] = 1;
    } else {
      dp[i][9] = 0;
    }
    for (long long int j = 8; j > 0; j--) {
      for (long long int k = arr[j]; k < i + 1; k++) {
        dp[i][j] += (((dp[i - k][j + 1]) % mod) * (dp1[i][k]) % mod) % mod;
        dp[i][j] %= mod;
      }
    }
    for (long long int k = arr[0]; k < i + 1; k++) {
      if (i <= 0) {
        continue;
      }
      dp[i][0] += (((dp[i - k][1]) % mod) * (dp1[i - 1][k]) % mod) % mod;
      dp[i][0] %= mod;
    }
    ans += dp[i][0];
    ans %= mod;
  }
  cout << ans << endl;
}
